0.1.2 • Published 6 years ago

process-cpu-usage v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

node-process-cpu-usage

Aim

Get % CPU usage of current node process.

Usage

const ProcessCPULoad = require('process-cpu-usage').ProcessCPULoad;

const tracker = new ProcessCPULoad();

tracker.start((total, user, system) => {
  console.log('CPU Usage: Total: %d, User: %d, System: %d', total, user, system);
});

Have a try

# start example server
$ cd bash
$ ./benchmark-server.sh

# start wrk benchmark client
$ ./benchmark-client.sh

# see the console output of script benchmark-server.sh

# and use read-load-by-ps.sh to see the CPU usage from linux ps command
$ ./read-load-by-ps.sh
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago