v8-profiler-trigger-electron

1.0.0 • Public • Published

v8-profiler-trigger-electron

Trigger CPU profile recording or heap snapshots for node apps using keyboard shortcuts.

NPM Badge

Taking a heap snapshot

Demo

  1. Start v8-profiler-trigger-electron once in your app
const v8ProfilerTrigger = require('v8-profiler-trigger-electron');
v8ProfilerTrigger();
  1. Press h followed by enter
  2. 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-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:

Flamegraph

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i v8-profiler-trigger-electron

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • paul.musso