Date: Fri, 5 Mar 2010 16:58:20 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: Peter Steele <psteele@maxiscale.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: Calculating kernel/user/idle time Message-ID: <20100305225818.GA12122@dan.emsphone.com> In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A640C@MBX03.exg5.exghost.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A640C@MBX03.exg5.exghost.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100305225818.GA12122>