-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for visualizing v8 profile gathered by CpuProfiler::Start…
…Profling
- Loading branch information
Showing
5 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function convert (profile) { | ||
const converted = { | ||
children: new Array(profile.children.length), | ||
name: `${profile.functionName} ${profile.url}:${profile.lineNumber}`, | ||
top: profile.hitCount, | ||
value: profile.hitCount, | ||
S: 0, | ||
} | ||
|
||
for (let i = 0; i < profile.children.length; i++) { | ||
converted.children[i] = convert(profile.children[i]); | ||
converted.value += converted.children[i].value; | ||
} | ||
|
||
return converted; | ||
} | ||
|
||
function convertV8Profile (profile) { | ||
const converted = convert(profile) | ||
return { | ||
merged: converted, | ||
unmerged: converted, | ||
} | ||
} | ||
|
||
module.exports = { | ||
convertV8Profile, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters