nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Add API to gets system load average information #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Neither Python nor psutil has an API to get the current system load average as 
shown by tools like top. On Linux it's easy to retrieve the current load 
through /proc/loadavg, see http://www.linuxinsight.com/proc_loadavg.html

I've attached a patch with a simple implementation of get_load_average()

Original issue reported on code.google.com by tiran79 on 8 Dec 2010 at 12:54

Attachments:

GoogleCodeExporter commented 8 years ago
No opinion on the patch, but python does have this as of 2.3.  
http://docs.python.org/library/os.html#os.getloadavg

$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getloadavg()
(1.52, 1.6399999999999999, 1.5700000000000001)

Original comment by philip.z...@gmail.com on 8 Dec 2010 at 2:31

GoogleCodeExporter commented 8 years ago
Oh, you are right ...

I'm currently in the process of replacing custom code with psutil. Some of my 
code is really, really old and predates Python 2.3. I rolled my own 
implementation of getloadavg() using /proc/loadavg many years ago and never 
checked if the os module has grown an official implementation.

Please dismiss my feature request.

Original comment by tiran79 on 8 Dec 2010 at 2:37

GoogleCodeExporter commented 8 years ago
Closing out as won't fix. 
Thanks for the inputs btw. New ideas are always welcome.

Original comment by g.rodola on 8 Dec 2010 at 2:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r266 == revision f910f2f333cc

Original comment by g.rodola on 2 Mar 2013 at 11:57