It is easy to do from /proc/stat. I thougt that the dificulty was not
how to do it, that if it was not included in screen byobu could not
add it instead.

>From /proc/stat

host:~$ cat /proc/stat | egrep ^cpu
cpu  1027415 128298 707661 10450261 335521 29714 53902 0 0
cpu0 1027415 128298 707661 10450261 335521 29714 53902 0 0

These are allways increasing counters that stands for time cpu spent
in iddle, running or wait.
If you read it periodically and make the difference you get how CPUs
spent time in this period. You do not need to worry about unit of
these numbers because you are calculating a percentage.

Searching at google for "linux cpu usage /proc/stat" throws a examples
and comments, but I am looking for documentation for the meaning of
each column. I do not remember wich column was idle or waiting. I
think I saw this in kernel doc, I think there is a similar per process
file in later kernels.

I will send you this info if I find.

Thanks,
txemi.

On Tue, Jan 26, 2010 at 5:06 AM, Dustin Kirkland <kirkl...@canonical.com> wrote:
> On Fri, 2010-01-22 at 14:40 +0100, Jose Miguel Martinez wrote:
>> I love byobu status bar. It is nice seeing system load, but I would 
>> appreciate seeing cpu usage too.
>> I did not find this in screen manual so this wishlist will probably have to 
>> be fordwarded to screen project.
>
> Thanks for the input.  I'll gladly add a cpu_usage status item, if you
> can suggest how to make such a calculation (ideally from some file
> in /proc or /sys).
>
> Cheers,
> :-Dustin
>



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to