From owner-freebsd-questions@FreeBSD.ORG Sat Mar 6 06:21:12 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 414101065672 for ; Sat, 6 Mar 2010 06:21:12 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from server505.appriver.com (server505a.appriver.com [98.129.35.4]) by mx1.freebsd.org (Postfix) with ESMTP id 09B0C8FC12 for ; Sat, 6 Mar 2010 06:21:11 +0000 (UTC) X-Policy: GLOBAL - maxiscale.com X-Primary: psteele@maxiscale.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: psteele@maxiscale.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->UNITED STATES X-Note-Sending-IP: 98.129.23.15 X-Note-Reverse-DNS: ht02.exg5.exghost.com X-Note-WHTLIST: psteele@maxiscale.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G179 G180 G181 G182 G186 G187 G198 G285 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from [98.129.23.15] (HELO ht02.exg5.exghost.com) by server505.appriver.com (CommuniGate Pro SMTP 5.3.2) with ESMTPS id 31065017 for freebsd-questions@freebsd.org; Sat, 06 Mar 2010 00:21:21 -0600 Received: from mbx03.exg5.exghost.com ([169.254.1.200]) by ht02.exg5.exghost.com ([98.129.23.15]) with mapi; Sat, 6 Mar 2010 00:18:48 -0600 From: Peter Steele To: "freebsd-questions@freebsd.org" Date: Sat, 6 Mar 2010 00:18:47 -0600 Thread-Topic: Calculating kernel/user/idle time Thread-Index: Acq8ubx0zDBkPBVdQZ2wDtgx1JnnTwAOuC/Q Message-ID: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A64F8@MBX03.exg5.exghost.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3A1A640C@MBX03.exg5.exghost.com> <20100305225818.GA12122@dan.emsphone.com> In-Reply-To: <20100305225818.GA12122@dan.emsphone.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: Calculating kernel/user/idle time X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2010 06:21:12 -0000 >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.