discoveryjs / cpupro

Rethinking of CPU profile analysis
https://discoveryjs.github.io/cpupro/
MIT License
450 stars 7 forks source link

how report.html be designed? #4

Closed wasonal closed 1 year ago

wasonal commented 1 year ago

how report.html be designed? Or how to covert cpuprofile to a list like Array<{ costTime: number, functionName: string, }>

lahmatiy commented 1 year ago

It's build with Discovery.js, its source can be found in app folder. You can run it locally with npm start command in the cloned repo.

If you need a subset of data, open a report page:

make report button

Write a query and copy JSON using "f" button:

query

Query example:

functions.({
  name,
  loc,
  selfTime,
  totalTime
})

You also can customize view:

image

Or just click "as table" in struct view:

image

Also you can use this link with prefilled query, just load you profile file using "Open file..." in top right corner.