STINNER Victor added the comment: > Pushed utility to github: https://github.com/jkloth/loadavg
Hum, I see two implementations: * LOADAVG_USE_REG: use the registry, RegQueryValueExW(HKEY_PERFORMANCE_DATA, L"2", ...) * LOADAVG_USE_PDH: PdhOpenQueryW() Are these API accessible by everyone? On Linux, the data is public to everybody: haypo@selma$ ls -l /proc/loadavg -r--r--r--. 1 root root 0 Jun 19 14:18 /proc/loadavg Why do you prefer registry over PDH? Should CalculateLoad be called every 5 seconds in a thread? If yes, IMHO it's a blocker issue for regrtest since some tests fail if other threads are running. I'm not sure that such code belongs to Python stdlib. What do you think of putting it on PyPI? For Python 2, sometimes I would like to use faulthandler on our buildbots since it's really hard to guess what crashed Python when a random test crash. But faulthandler was only added to Python 3.3. So using it on Python 2 would require to install it using pip. Right now, Python only requires itself to run tests. I'm not sure that it's a good idea to have dependencies, even if there are externals. Again, I'm not sure that this specific issue is the best place to discuss implementing "os.getloadavg()", since your implementation is more complex than a single function call, it seems like it requires to run a thread "in background", so maybe an object to start/stop the thread, etc. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30263> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com