node-remote-pprof
v0.0.10
Published
Support for google-perftools remote profiling with NodeJS
Downloads
43
Maintainers
Readme
node-remote-pprof
Library that implements the google-perftools remote interface as a Express/Connect-compatible router.
Installation
npm install --save node-remote-pprof
Usage
Add the
/pprof
endpoint to your applicationconst express = require('express'); const pprof = require('node-remote-pprof'); const app = express(); app.use('/pprof', pprof()); app.listen(3000);
Run the application
node --perf-basic-prof .../app.js
The
--perf-basic-prof
command-line is needed for resolving Javascript symbols dynamically.Use the
pprof
tool to profile the applicationpprof --web localhost:3000
Note: Either the original
pprof
or the go version should work here.
Environment
This library is very rough, and only got light testing on mac OS High Sierra and some Linux derivates. Expect bugs and missing features.
By default the application will run with heap profiling disabled, this can be controlled by settingthe HEAPPROFILE
environment variable to the prefix of the heap dumps to create.
Alpine Linux/musl is not supported right now: See https://github.com/gperftools/gperftools/issues/693 for details and further links.
License
Apache-2.0.