1.0.0 • Published 7 years ago
v8-profiler-trigger-electron v1.0.0
v8-profiler-trigger-electron
Trigger CPU profile recording or heap snapshots for node apps using keyboard shortcuts.
Taking a heap snapshot
Start v8-profiler-trigger-electron once in your app
const v8ProfilerTrigger = require('v8-profiler-trigger-electron'); v8ProfilerTrigger();
Press
h
followed by enterThats 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-electron --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
1.0.0
7 years ago