v8-profiler-trigger
v1.0.1
Published
Trigger CPU profile recording or heap snapshots for node apps using keyboard shortcuts
Downloads
6
Maintainers
Readme
v8-profiler-trigger
Trigger CPU profile recording or heap snapshots for node apps using keyboard shortcuts.
Taking a heap snapshot
- Start v8-profiler-trigger once in your app
const v8ProfilerTrigger = require('v8-profiler-trigger');
v8ProfilerTrigger();
- Press
h
followed by enter - Thats it, you can now load the saved .heapsnapshot to Chrome debugger
In debugger, open Profiles
tab. Click Load and
open the .heapsnapshot.
Install
npm install v8-profiler-trigger --save-dev
API
v8ProfilerTrigger([opts])
Starts the V8 profiler trigger listeners.
opts
{
// Trigger snapshots or recording via stdin events.
// The only method supported currently is 'stdin'.
listenMethod: 'stdin',
// Changes default CPU profiler sampling interval to the specified
// number of microseconds. Default interval is 1000us.
samplingInterval: 1000
}
Usage
Examples how to use the v8-profiler.
CPU Profiling
You can use Chrome debugger to interactively inspect results:
License
MIT