Skip to content

Commit d5c8d3b

Browse files
author
David Mark Clements
committed
v8-profile -> cpu-profile
1 parent 5760ab4 commit d5c8d3b

21 files changed

+61
-6465
lines changed

cmd.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function cmd (argv, banner = defaultBanner) {
5858
version: 'v',
5959
help: 'h',
6060
visualizeOnly: 'visualize-only',
61-
visualizeV8Profile: 'visualize-v8-profile',
61+
visualizeCpuProfile: 'visualize-cpu-profile',
6262
collectOnly: 'collect-only',
6363
kernelTracing: 'kernel-tracing',
6464
kernelTracingDebug: 'kernel-tracing-debug',
@@ -90,8 +90,8 @@ async function cmd (argv, banner = defaultBanner) {
9090
status(`Creating flamegraph from ${args.visualizeOnly}`)
9191
}
9292

93-
if (args.visualizeV8Profile) {
94-
status(`Creating flamegraph from v8 profile ${args.visualizeV8Profile}`)
93+
if (args.visualizeCpuProfile) {
94+
status(`Creating flamegraph from v8 profile ${args.visualizeCpuProfile}`)
9595
}
9696

9797
const assetPath = await zeroEks(args)
File renamed without changes.

examples/cpu-profiler/flamegraph.png

400 KB
Loading

examples/v8-profiler/index.js renamed to examples/cpu-profiler/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ router.get('/start-profiling', (ctx, next) => {
2222
router.get('/stop-profiling', async (ctx, next) => {
2323
const result = v8Profiler.stopProfiling('p1')
2424
if (result) {
25-
await writeFile('./v8-profile.json', JSON.stringify(result))
25+
await writeFile('./samples.cpuprofile', JSON.stringify(result))
2626
ctx.body = 'saved profile'
2727
} else {
2828
ctx.body = 'nothing to show'

examples/v8-profiler/README.md renamed to examples/cpu-profiler/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 0x-visualize-v8-profile-example
1+
# visualize .cpuprofile example
22

33
You need curl installed. This will probably work on linux and macOS.
44

@@ -9,6 +9,6 @@ npm i
99
./test.sh
1010
```
1111

12-
Then open flamegraph.html, click on `v8` button and you should see something like this:
12+
Then open flamegraph.html and you should see something like this:
1313

1414
![flamegraph](flamegraph.png)

examples/cpu-profiler/samples.cpuprofile

+1
Large diffs are not rendered by default.

examples/v8-profiler/test.sh renamed to examples/cpu-profiler/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ curl -v http://localhost:3000/stop-profiling
1414
sleep 3
1515
kill -KILL $first_pid
1616

17-
node node_modules/.bin/0x --visualize-v8-profile v8-profile.json
17+
node node_modules/.bin/0x --visualize-cpu-profile samples.cpuprofile

examples/v8-profiler/flamegraph.png

-385 KB
Binary file not shown.

0 commit comments

Comments
 (0)