Skip to content

bengl/cli-profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cli-profile

cli-profile is a simple wrapper around v8-profiler, making it easy to use for CLI tools in node.

Usage

Invoke it as if it's node. For example, to profile an npm install:

$ cli-profile `which npm` install

All the arguments are passed to program you're profiling. This will then generate a timestamped .cpuprofile file in the current directory, which you can then load up into Chrome Dev Tools, or use flamegraph.

To generate a flamegraph from a cpu profile:

$ npm i -g flamegraph
$ cat *.cpuprofile | flamegraph -t cpuprofile > graph.svg

The profile will run from the time the program starts until either process.exit is called or the beforeExit event is emitted on process. This corresponds to the lifetime of the program being profiled.

License

MIT. See LICENSE.txt

About

generate cpu profiles of cli tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published