Python os.getloadavg() Method
Example
Get the load average over last 1, 5 and 15 minutes:
#Import os Library
import os
#print load average over the last 1, 5, and 15 minutes
print (os.getloadavg())
Try it Yourself »
Definition and Usage
The os.getloadavg()
method returns the load average over the last 1, 5, and 15 minutes.
This indicates the number of processes in the system run queue (over the last 1, 5, and 15 minutes).
Note: For Unix platform only.
Syntax
os.getloadavg()
Technical Details
Return Value: | A tuple value, representing the load average over the last 1, 5, and 15 minutes |
---|---|
Python Version: | 2.3 |