node-usage
v0.0.3
Published
a process usage monitor with nodejs
Downloads
21
Readme
node-usage
a process usage monitor with nodejs
- support MEM, RSS, VSZ, %MEM, %CPU
- support process group usage monitor
usage
$ npm install node-usage
then just use it in your codes like this
import UsageMonitor from 'node-usage';
const memMonitor = new UsageMonitor({ interval: 500 });
memMonitor.run(p.pid, (err, data) => {
console.log(data);
});
the default monitor will count child process memory, virtual memory size, and physical resident memory into result. you can disable it like this:
memMonitor.run(p.pid, { countChild: false }, (err, data) => {
console.log(data);
});
LICENSE
MIT