[collectd] cpu module and saving jiffies / OpenBSD

Sebastian Harl sh at tokkee.org
Mon Aug 4 17:22:50 CEST 2008


Hi Michael,

On Fri, Aug 01, 2008 at 04:08:32PM +0200, Michael Stapelberg wrote:
> I'm using collectd on OpenBSD (previously on linux) and I noticed that the cpu
> plugin saves broken values. That is, my CPU would be idle 126% ;-).
> 
> I'm not sure how you accomplish putting jiffies (from /proc/stat) to rrdtool
> and getting percentage values in the file actually...

We don't. The values stored in the RRD-files are jiffies. That's why
they don't necessary have to sum up to 100. Converting that into a
percentage value is up to some front-end.

On Linux, the default is usually to have 100 jiffies per second. So, in
that case, you automagically get a percentage value.

> Anyway, as the CPU stats are collected on OpenBSD using libstatgrab which also
> support percentages, I changed the cpu-rrd-files to use GAUGE and cpu.c to
> submit a gauge_t. Now the values are accurate. I wonder why this is not by
> default a GAUGE? Are there any reasons or should we change it?

The cpu plugin has originally been developed for Linux (as most other
plugins as well). /proc/stats provides counter values, so that's why
COUNTER has been used.

Since this question comes up quite frequently and using jiffies seems to
confuse quite a few users, we might think about changing that at some
point in the future. However, prior to that, somebody would have to
double check if percentage values could be collected on all platforms
currently supported by the cpu plugin.

However, this change would require a backward-incompatible change to the
cpu RRD files, so this won't happen before version 5.0. Also, this
change would have to be done for _all_ supported platforms
simultaneously, as else we'd get different RRD files for different
platforms which would basically make a heterogeneous environment
impossible.

HTH,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080804/fcf59234/attachment.pgp 


More information about the collectd mailing list