Getting the load average of CPU
The load average of CPU: os.loadavg()
The os
module has the loadavg()
method to return the βloadβ measurement information about the CPU usage of the system.
The βloadβ measurement is calculated by the number of processes that are being executed by the CPU or in a βwaitingβ state.
The loadavg()
function returns an array with 3 float numbers. These three numbers represents the average system load calculated over a given period of 1, 5 and 15 minutes
{quote} On Windows machine this functionality is not available, the method returns an array with 0 values, like
[0, 0, 0]