Re: Getting CPU load (from /proc/?)
William T Wilson <fluffy@snurgle.org> writes:
> It's a good guess. In technical terms the load average is simply the
> average number of processes in the runnable state over a period of time.
> You could take an instantaneous measurement of the number of processes in
> the runnable state, but it wouldn't be a meaningful number. (In fact,
> this information is already produced by ps - running processes are marked
> with 'R'). It's entirely possible that a lightly loaded system could have
> many running processes at any particular moment, or that a heavily loaded
> system could have few.
Come to think of it, I too would like to have a more fine-grained cpu
load measurement. I want my machine to suspend after a period of no
mouse/keyboard activity and minimal cpu load. Right now I check the
latter by looking at /proc/loadavg, except these numbers quickly reach
zero, even when I have a streaming mp3 playing in the background. The
idea is, I don't want the machine to suspend if it's playing an mp3. I
only want it to suspend if it is doing practically nothing.
-chris
Reply to: