Python | os.getloadavg() method
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.getloadavg() method in Python is used to get the load average over the last 1, 5, and 15 minutes. The load average is the average of the number of processes in the system run queue over a given period of time over 1, 5 and 15 minutes. This method raises OSError if the load average is unobtainable.
Note: This method is available on UNIX platforms only.
Parameter: No parameter is required.
Return Type: This method returns a tuple object consisting of float values which denotes the load average over the last 1, 5, and 15 minutes.
Load average over the last 1 minute: 0.34 Load average over the last 5 minute: 0.42 Load average over the last 15 minute: 0.46
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course