-
1. Re: How CPU utilization is worked out in the analysis?
devendragera Mar 5, 2008 4:59 PM (in response to rkdesai_2001)Hi,
I am from the same company as Rakesh. We would like to know how is the %cpu calculated in the Processes executed report. When we ran the profiler, it showed method x at the top with max. %cpu, but running the test second time showed some other methody at the top. Also the methods were called multiple times. What does %cpu actually represent in such cases?
Thanks in Advance,
Dev -
2. Re: How CPU utilization is worked out in the analysis?
clebert.suconic Mar 10, 2008 9:06 PM (in response to rkdesai_2001)The CPU is calculated over the clocks counter over GetCurrentThreadCPUTimer.
http://java.sun.com/j2se/1.5.0/docs/guide/jvmpi/jvmpi.html#GetCurrentThreadCpuTime
The logger will write the Timer when the method is in, and out.. and during the calculation (or processing) this is stacked and calculated.
Say... When you stack calls, Method A will call Method B, C and D.
Say.. .if method A took 100 Milliseconds on the CPU Timer, than B. C and D took 50, 40, and 10 Milliseconds, each one will be 50%, 40% and 10%. (Simple calculation)
Notice that sometimes Method A itself will consume CPU, so you won't have B+C+D=100% all the time.