0.0.3 • Published 10 years ago
node-usage
Licence
ISC
Version
0.0.3
Deps
0
Vulns
0
Weekly
0
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