Skip to content

Instantly share code, notes, and snippets.

@shanselman shanselman/dumpme
Created Mar 28, 2017

What would you like to do?
app.get('/dumpme', function (req, res) {
var fs = require('fs'),
ws = fs.createWriteStream('debugdump/' + '.heapsnapshot'),
profiler = require('v8-profiler'),
snapshot = profiler.takeSnapshot(),
callback = ws.end.bind(ws);
snapshot.serialize(function(data) {
ws.write('' + data);
}, callback);//begin cpu profiling

This comment has been minimized.

Copy link

desibot commented May 8, 2018

awesome post baby . keep it up. Facebook auto follow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.