[collectd] cpu stats on SMP machines
Doug MacEachern
Doug.MacEachern at springsource.com
Fri Sep 25 22:43:17 CEST 2009
On Sep 24, 2009, at 11:54 PM, Florian Forster wrote:
> Hi Doug,
>
> On Wed, Sep 23, 2009 at 11:36:26AM -0700, Doug MacEachern wrote:
>> "kern.cp_times" as of 7.0-ish:
>> http://github.com/hyperic/sigar/commit/039080f722b66d825e557d941986eca0e3956ab4
>> I can make a patch later this week unless somebody else wants to.
>
> thanks for the pointer :) Looks pretty straight forward … If you don't
> have time let me know and I'll adapt that code (hooray for free
> licenses! :) for collectd.
Hi Florian,
I pushed a branch with the changes here: http://github.com/dougm/collectd/tree/kern_cp_times
And tested on the systems below. Bill, let us know if you have a
chance to test.
-Doug
% sysctl kern.version kern.smp.active hw.ncpu
kern.version: FreeBSD 7.2-RC1 #0: Wed Apr 15 19:47:40 UTC 2009
root at driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
kern.smp.active: 1
hw.ncpu: 2
% ./src/collectd -T -C ~/test/cpu.conf
PUTVAL sid.hyperic.net/cpu-0/cpu-user interval=10 1253893409:136790
PUTVAL sid.hyperic.net/cpu-0/cpu-nice interval=10 1253893409:272
PUTVAL sid.hyperic.net/cpu-0/cpu-system interval=10 1253893409:682276
PUTVAL sid.hyperic.net/cpu-0/cpu-idle interval=10 1253893409:285778574
PUTVAL sid.hyperic.net/cpu-0/cpu-interrupt interval=10 1253893409:8052
PUTVAL sid.hyperic.net/cpu-1/cpu-user interval=10 1253893409:123053
PUTVAL sid.hyperic.net/cpu-1/cpu-nice interval=10 1253893409:284
PUTVAL sid.hyperic.net/cpu-1/cpu-system interval=10 1253893409:704460
PUTVAL sid.hyperic.net/cpu-1/cpu-idle interval=10 1253893409:285737720
PUTVAL sid.hyperic.net/cpu-1/cpu-interrupt interval=10 1253893409:39820
[2009-09-25 08:43:29] Exiting normally.
% sysctl kern.version kern.smp.active hw.ncpu
kern.version: FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008
root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
kern.smp.active: 0
hw.ncpu: 1
% ./src/collectd -T -C ~/test/cpu.conf
PUTVAL vmfbsd-001/cpu-0/cpu-user interval=10 1253909995:575845
PUTVAL vmfbsd-001/cpu-0/cpu-nice interval=10 1253909995:1420
PUTVAL vmfbsd-001/cpu-0/cpu-system interval=10 1253909995:7042194
PUTVAL vmfbsd-001/cpu-0/cpu-idle interval=10 1253909995:313855223
PUTVAL vmfbsd-001/cpu-0/cpu-interrupt interval=10 1253909995:567267
[2009-09-25 13:19:55] Exiting normally.
% grep KERN_CP_TIMES src/config.h
/* #undef HAVE_SYSCTL_KERN_CP_TIMES */
More information about the collectd
mailing list