Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to gets system load average information #139

Closed
giampaolo opened this issue May 23, 2014 · 4 comments
Closed

Add API to gets system load average information #139

giampaolo opened this issue May 23, 2014 · 4 comments

Comments

@giampaolo
Copy link
Owner

From tiran79 on December 08, 2010 01:54:38

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()

Attachment: simple_loadavg.patch

Original issue: http://code.google.com/p/psutil/issues/detail?id=139

@giampaolo
Copy link
Owner Author

From philip.z...@gmail.com on December 07, 2010 18:31:29

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)

@giampaolo
Copy link
Owner Author

From tiran79 on December 07, 2010 18:37:21

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.

@giampaolo
Copy link
Owner Author

From g.rodola on December 07, 2010 18:46:31

Closing out as won't fix. 
Thanks for the inputs btw. New ideas are always welcome.

Status: WontFix
Labels: -Type-Defect Type-Enhancement OpSys-UNIX

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:57:20

Updated csets after the SVN -> Mercurial migration: r266 == revision 
f910f2f333cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant