[collectd] Plugin cpu and "merged" stat

Sebastian Harl sh at tokkee.org
Wed Jan 14 12:12:57 CET 2009


Hi Greg,

On Wed, Jan 14, 2009 at 11:18:28AM +0100, Greg wrote:
> Hi Florian,
> 
> > no, right now that's not possible.
> >
> > Personally, I value the per-CPU information, but if someone hands in a
> > patch to add a `Combine true|false' configuration option, I don't see
> > why that patch shouldn't be accepted.
> >
> >   
> 
> Seems the patch will be easy, something like :
> 
> 305c305
> <               if ((buf[3] < '0') || (buf[3] > '9'))
> ---
>  >               if ((buf[3] < '0') || (buf[3] > '9') && (buf[3] != ' '))

It's not quite as easy as that:

 - imho that behavior should be made optional, thus you need to
   introduce a new config option + documentation
 - the plugin instance would have to be handled separately (with your
   patch the combined stats would be attached to the cpu0 stats, since
   atoi(" ") returns 0 - at least on my GNU/Linux box)
 - The non-Linux cases would have to be handled as well, e.g. in the
   PROCESSOR_CPU_LOAD_INFO case, the plugin would have to sum up the
   individual values (another reason why this should be optional)

All of that should be fairly trivial though - would you like to give it
a try?

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/20090114/ca1fea9f/attachment.pgp 


More information about the collectd mailing list