Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Oct 10, 2018
1 parent 424b391 commit 85c3a08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/import/chrome.ts
Expand Up @@ -271,7 +271,7 @@ export function importFromChromeCPUProfile(chromeProfile: CPUProfile): Profile {
* There is two difference between the two formats : * There is two difference between the two formats :
* - Nodes are a tree in the old and a flat array in the new * - Nodes are a tree in the old and a flat array in the new
* - Weigth are timestamps in the old and delta in the new * - Weigth are timestamps in the old and delta in the new
* *
* For more informations : https://github.com/hyj1991/v8-profiler-node8 * For more informations : https://github.com/hyj1991/v8-profiler-node8
*/ */
export function importFromOldV8CPUProfile(content: OldCPUProfile): Profile { export function importFromOldV8CPUProfile(content: OldCPUProfile): Profile {
Expand Down
7 changes: 6 additions & 1 deletion src/import/index.ts
@@ -1,7 +1,12 @@
import {Profile, ProfileGroup} from '../lib/profile' import {Profile, ProfileGroup} from '../lib/profile'
import {FileSystemDirectoryEntry} from './file-system-entry' import {FileSystemDirectoryEntry} from './file-system-entry'


import {importFromChromeCPUProfile, importFromChromeTimeline, isChromeTimeline, importFromOldV8CPUProfile} from './chrome' import {
importFromChromeCPUProfile,
importFromChromeTimeline,
isChromeTimeline,
importFromOldV8CPUProfile,
} from './chrome'
import {importFromStackprof} from './stackprof' import {importFromStackprof} from './stackprof'
import {importFromInstrumentsDeepCopy, importFromInstrumentsTrace} from './instruments' import {importFromInstrumentsDeepCopy, importFromInstrumentsTrace} from './instruments'
import {importFromBGFlameGraph} from './bg-flamegraph' import {importFromBGFlameGraph} from './bg-flamegraph'
Expand Down
7 changes: 3 additions & 4 deletions src/import/v8cpuFormatter.ts
@@ -1,4 +1,3 @@

import {CPUProfile, CPUProfileNode} from './chrome' import {CPUProfile, CPUProfileNode} from './chrome'


export interface OldCPUProfileNode { export interface OldCPUProfileNode {
Expand Down Expand Up @@ -28,10 +27,10 @@ function treeToArray(node: OldCPUProfileNode, nodes: CPUProfileNode[]) {
functionName: node.functionName, functionName: node.functionName,
lineNumber: node.lineNumber, lineNumber: node.lineNumber,
scriptId: node.scriptId, scriptId: node.scriptId,
url: node.url url: node.url,
}, },
hitCount: node.hitCount, hitCount: node.hitCount,
children: node.children.map(child => child.id) children: node.children.map(child => child.id),
}) })
node.children.forEach(child => { node.children.forEach(child => {
return treeToArray(child, nodes) return treeToArray(child, nodes)
Expand All @@ -57,6 +56,6 @@ export function chromeTree2nodes(content: OldCPUProfile): CPUProfile {
startTime: content.startTime * 1000000, startTime: content.startTime * 1000000,
endTime: content.endTime * 1000000, endTime: content.endTime * 1000000,
nodes: treeToArray(content.head, []), nodes: treeToArray(content.head, []),
timeDeltas: timestampsToDelta(content.timestamps, content.startTime) timeDeltas: timestampsToDelta(content.timestamps, content.startTime),
} }
} }

0 comments on commit 85c3a08

Please sign in to comment.