[collectd] cpu module and saving jiffies / OpenBSD

Sebastian Harl sh at tokkee.org
Mon Aug 4 18:18:10 CEST 2008


Hi Michael,

On Mon, Aug 04, 2008 at 05:39:28PM +0200, Michael Stapelberg wrote:
> * [04.08.08 17:25]:
> > On Linux, the default is usually to have 100 jiffies per second. So, in
> > that case, you automagically get a percentage value.
> Yeah, that's what made no sense to me at first ;-).

Yeah, this should be added to the FAQ. I'm sure, Florian will do so
shortly.

> > 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
> Not only it confuses some users, but using jiffies (or whatever the equivalent
> is) just plainly does not work well on OpenBSD. Using percentages is much
> butter in this case.

According to the libstatgrab documentation, sg_get_cpu_stats() returns
the number of ticks the OS has spent in the various states, so it
provides the exact same information as /proc/stat on Linux. I'm not sure
if a jiffy may be configured on OpenBSD or how to determine it's value
but this should work equally well as on Linux as far as I see it.

> > 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.
> I'm not so familiar with your concept of dependencies, but libstatgrab, which
> has to be used on OpenBSD for collecting these values, does provide
> cross-platform percentage measurement of CPU usage.

I wouldn't like to see a dependency being pulled in for one of the
(imho) core plugins. Anyway, percentage values could be calculated in a
couple of different ways. E.g. one could try to determine the value of a
jiffy or sum up all different types of counters and calculate percentage
values from there. But, frankly, I'm quite happy with using jiffies, so
I'd expect to get patches ;-)

Cheers,
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/f175d465/attachment.pgp 


More information about the collectd mailing list