You need to take the difference over a period of time and then factor in the run occupancy.
Below two
perfstat_cpu_total_t data structures called cpu_tot_p and cpu_tot_q -> the current (p) and previous values (q)
#define DELTA(member) (cpu_tot_p->member - cpu_tot_q->member)
if (DELTA(runque) == 0 || DELTA(runocc) == 0)
pdouble("run_queue", 0.0);
else
pdouble("run_queue", ((double)(DELTA(runque))) / ((double)(DELTA(runocc)))); /* fixed */
I am nosy, what are you actually up to with this cost?
Perhaps, I have suggestions that could help.
Cheers Nigel @mr_nmon
------------------------------
Nigel Griffiths
------------------------------