pm2/examples/v1/expose_method.js
2016-08-07 02:16:13 -07:00

12 lines
303 B
JavaScript

/*
* Example of usage : https://github.com/Unitech/pm2/pull/214
*/
process.on("message", function (msg) {
console.log('got message', msg);
if ( "type" in msg && msg.type === "god:heap" ) {
var heap = process.memoryUsage().heapUsed;
process.send({type:"process:heap", heap:heap});
}
});