Tomas Edwardsson
2011-02-04 01:16:03 UTC
This patch introduces a new module, cpu.py and includes fixes for disk.py and service.py.
cpu.py exposes cpu information. It has two methods:
* cpu_sample_percentage - gets the average cpu usage, returns per cpu percentage for user, nice, system, idle, iowait and irq.
* jiffies - fetches cpu statistics from /proc/stat and returns them
disk.py modifications
* Add filesystem type returned by disk.usage()
service.py modifications
* chkconfig and /sbin/service now run with environment variable LANG=C, tools were returning internationalized strings which wouldn't parse correctly.
* Rewrote get_running(), now lists scripts from /etc/init.d and runs status itself instead of running /sbin/service --status-all. /sbin/service was returning internationalized strings and ignoring LANG variable.
cpu.py exposes cpu information. It has two methods:
* cpu_sample_percentage - gets the average cpu usage, returns per cpu percentage for user, nice, system, idle, iowait and irq.
* jiffies - fetches cpu statistics from /proc/stat and returns them
disk.py modifications
* Add filesystem type returned by disk.usage()
service.py modifications
* chkconfig and /sbin/service now run with environment variable LANG=C, tools were returning internationalized strings which wouldn't parse correctly.
* Rewrote get_running(), now lists scripts from /etc/init.d and runs status itself instead of running /sbin/service --status-all. /sbin/service was returning internationalized strings and ignoring LANG variable.
--
Tomas Edwardsson
Tomas Edwardsson