On 07/08/15 23:19, Rohan Arora wrote:
If I simply do a metricConvert() for kernel.all.cpu.user and then divide
the value by 10, I end up with values that are ~30% higher than what top
shows me, or it shows 0% when top does not. However, I do get values
that are quite close by doing the following:
float(user) / (user + nice + sys + idle + intr + steal + guest
+ vuser + total + soft + hard) * 100
Do you know why there might such a difference in the values using the
method that you described and top? Also, is the method I mentioned above
a valid way to measure the user cpu usage?
How many CPUs in your system?
For an N CPU system, the kernel.all.cpu.* metrics will sum to N,000
milliseconds per second, so to get percentages in the range 0-100 you
typically have to divide by hinv.ncpu.
|