[collectd] Making monitoring of heterogeneous environments easier with percentage based metrics

Jeremy Katz katzj at fedoraproject.org
Mon Jan 13 16:17:19 CET 2014

On Mon, Jan 13, 2014 at 4:50 AM, Florian Forster <octo at collectd.org> wrote:

> On Tue, Jan 07, 2014 at 07:47:25PM -0500, Jeremy Katz wrote:
> > In larger environments which have heterogeneous resources it's frequently
> > useful to look at utilization of various resources as percentages.
> > […]
> > But all of these end up having a ton of repetition.
> I agree that the amount of repetition is bad and some infrastructure to
> simplify these calculations would be nice. I would, however, prefer not
> to make this a truly global option.

I can definitely go either way.  I just think that the number of places it
will apply is going to actually be pretty high.  Going through and adding
ReportAbsolute and ReportPercentage to relevant plugins isn't hard either,
though with either of the options below.

> What do you think about an interface like this:

>   int plugin_dispatch_set (value_list_t const *vl,
>       size_t          argc,
>       char const    **type_instances,
>       gauge_t const  *values,
>       _Bool           percentage);

>   __attribute__((sentinel))
>   int plugin_dispatch_list (value_list_t const *vl,
>       _Bool percentage, ...);
>   plugin_dispatch_list (vl, 1, "free", 100.0, "cached", 200.0,
>       "buffered", 300.0, "used", 1000.0, NULL);

The varargs version feels a little cleaner and easier to use in plugins
where there are lots of possibilities for different sets of values as many
of these will be.  That said, both would work so I don't know that I'd feel
that strongly.  As Yves says, you can screw either up really :)

- Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20140113/f7a0bd46/attachment.html>

More information about the collectd mailing list