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 |