On Wednesday 07 November 2007, James wrote:
> All,
>
> I'm writing a piece of code that requires I gather the following
> statistics every second:
>
> - CPU Usage (as a percentage)
> - NIC I/O
> - Hard Drive I/O
>
> I later have to correlate these stats as a function of time.
>
> I'm not really sure where I should be looking to gather these
> statistics.  I know about /proc/stat, but that's only CPU related (and
> I don't think /proc/sys will give me a CPU usage percentage anyways).
> I'm not sure if there exist other proc files that will give me the
> values for NIC and hard drive I/O (such as number of transactions per
> second).
>
> Thoughts?

First thought that comes in my mind is to have a look at source code of such 
programms as:
        - gkrellm
        - top/htop
        - iptraf
I think you can find there all information you need



-- 
best regards,
Aleksey V. Kunitskiy
my public GPG/PGP key: http://www.alexey-kv.org.ua/pubkey.asc

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to