get-loadavg

1.0.0 • Public • Published

get-loadavg

returns the load average for the Unix-like systems but in an object


Build StatusCode Coverage 100%ISC LicenseNodeJS

JavaScript Style Guide

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
  }
}

ISC License (ISC)

Package Sidebar

Install

npm i get-loadavg

Weekly Downloads

58

Version

1.0.0

License

ISC

Last publish

Collaborators

  • quim