get-loadavg
v1.0.0
Published
returns the load average for the Unix-like systems but in an object
Downloads
340
Maintainers
Readme
get-loadavg
returns the load average for the Unix-like systems but in an object
api
returns an object with the following properties:
- idle % of CPU idle of the time - this property should be returned when the load is below the number of CPUs
- overload % of CPU overloaded on average - this property should be returned when the load is above the number of CPUs
- processes % of processes were waiting for the CPU - this property should be returned when the load is above the number of CPUs
example
const getLoadAvg = require('get-loadavg')
// let's suppose that the current loadavg is [9.19921875, 5.2197265625, 3.16796875] and we have 4 CPUs
getLoadAvg()
// should return
{
one: {
overload: 519.92,
processes: 5.2
},
five: {
overload: 121.97,
processes: 1.22
},
fifteen: {
idle: 20.8
}
}