node-remote-pprof v0.0.10
node-remote-pprof
Library that implements the google-perftools remote interface as a Express/Connect-compatible router.
Installation
npm install --save node-remote-pprofUsage
Add the
/pprofendpoint 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.jsThe
--perf-basic-profcommand-line is needed for resolving Javascript symbols dynamically.Use the
pproftool to profile the applicationpprof --web localhost:3000Note: Either the original
pprofor 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.