In the last episode (Mar 05), Peter Steele said:

> What's the proper way to calculate kernel/user/idle time? I know the raw
> values come from sysctl kern.cp_time, but these values need to be
> "massaged" based on the number of CPUs and so on.  Can someone explain
> briefly what the algorithm is calculating the final percentages
> representing these times.

They shouldn't need to be massaged.  Just sample the values at two
intervals, and your percentages can be calculated by dividing each delta by
the sum of the deltas (since the sum equals the total CPU usage over the
interval, by definition).  If you want to calculate per-cpu usage, use the
kern.cp_times sysctl instead.

-- 
        Dan Nelson
        dnel...@allantgroup.com
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to