1.0.0 • Published 8 years ago

get-loadavg v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

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)