Gentoo Archives: gentoo-user

From: "Aleksey V. Kunitskiy" <alexey.kv@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Getting system stats
Date: Wed, 07 Nov 2007 22:31:37
Message-Id: 200711080023.55378.alexey.kv@gmail.com
In Reply to: [gentoo-user] Getting system stats by James
1 On Wednesday 07 November 2007, James wrote:
2 > All,
3 >
4 > I'm writing a piece of code that requires I gather the following
5 > statistics every second:
6 >
7 > - CPU Usage (as a percentage)
8 > - NIC I/O
9 > - Hard Drive I/O
10 >
11 > I later have to correlate these stats as a function of time.
12 >
13 > I'm not really sure where I should be looking to gather these
14 > statistics. I know about /proc/stat, but that's only CPU related (and
15 > I don't think /proc/sys will give me a CPU usage percentage anyways).
16 > I'm not sure if there exist other proc files that will give me the
17 > values for NIC and hard drive I/O (such as number of transactions per
18 > second).
19 >
20 > Thoughts?
21
22 First thought that comes in my mind is to have a look at source code of such
23 programms as:
24 - gkrellm
25 - top/htop
26 - iptraf
27 I think you can find there all information you need
28
29
30
31 --
32 best regards,
33 Aleksey V. Kunitskiy
34 my public GPG/PGP key: http://www.alexey-kv.org.ua/pubkey.asc

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Getting system stats Daniel Iliev <daniel.iliev@×××××.com>