On a linux system, your standard uptime command returns the following:
6.46, 6.00, 4.51
As most of you will probably know, these correspond to 1, 5 and 15 minute load averages.
I was wondering if it were possible to either pull from somewhere ( /proc/ … ? ) or manually parse ( ps aux? ) out a more real time snapshot of the systems load average?
Can this be parsed / pulled from anywhere?
You could watch /proc/uptime, which contains the cpu time spent doing something vs. total time. By monitoring this repeatedly, you can effectively acquire samples for any EWMA window of your choosing.
Or, if you like a challenge, you can obtain
old_loadavg_valueandnew_loadavg_valuefrom /proc/loadavg and solve the linear systemfor
new_sample, and then do the calculation forwards again with analphareflecting your desired window.