Re: Where can we download the "vzstat" source code? [message #32962 is a reply to message #2687] |
Thu, 11 September 2008 01:55 |
gurtaj
Messages: 12 Registered: September 2008 Location: London, Ontario, Canada
|
Junior Member |
|
|
Hello. I've found this message while looking for information about how to calculate the CPU usage percentage of a container (yeah... one more trying to do the same).
The fact is that I'm having some troubles, so I'd appreciate any help.
I started a container (# 109) and captured the following values:
VEID user nice system uptime idle strv uptime used maxlat totlat numsched
109 9 0 30 225316 4494871181910 0 4494982391820 793267650 0 0 0
So, let's start with the calculations:
- if jiffies_per_second = 1000 (as indicated by dev), the first uptime value equals 225.316 seconds.
Anyway, I was trying to match both uptime values, the one in jiffies and the one in cycles.
As far as I understand, the second value should be divided by cycles_per_jiffy:
CPU: Intel Core Duo T2450 @ 2.00 GHz
CPU MHz: 1995.115
cycles_per_jiffy = 1995115 / 1000 = 1995.115
(which seems pretty small compared with the one given by dev as example of his processor, which I guess it was a 1.86 GHz)
Now, if I devide the second uptime value by the previously obtained cycles_per_jiffy:
seconds = uptime / cycles_per_jiffy = 4494982391820 / 1995.115 = 22527270349023.399653654
... OK, the value starts similar, but they are quite different.
So... what I'm understanding wrong?
Thanks for the help!
|
|
|