Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Mar 2010 00:18:47 -0600
From:      Peter Steele <psteele@maxiscale.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   RE: Calculating kernel/user/idle time
Message-ID:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A64F8@MBX03.exg5.exghost.com>
In-Reply-To: <20100305225818.GA12122@dan.emsphone.com>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A640C@MBX03.exg5.exghost.com> <20100305225818.GA12122@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>They shouldn't need to be massaged.  Just sample the values at two interva=
ls, and your percentages can be calculated by dividing
>each delta by the sum of the deltas (since the sum equals the total CPU us=
age over the interval, by definition).  If you want to
>calculate per-cpu usage, use the kern.cp_times sysctl instead.

That's the detail I was missing, needing to take two samples. That should s=
olve the problem I was having. Thanks.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A64F8>