X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.h;h=924c842d28de940b5522dfb200a440e1ac7f585d;hb=f2398e39bc84d49081ca5bdd216584acf70013a0;hp=8f0c6d86105fbfe56547d6b5d78ac9fd7a7f4b26;hpb=42612558ff8279a80e32cc68d26b1b1bee800f4f;p=collectd.git diff --git a/src/plugin.h b/src/plugin.h index 8f0c6d86..924c842d 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -2,7 +2,7 @@ #define PLUGIN_H /** * collectd - src/plugin.h - * Copyright (C) 2005-2011 Florian octo Forster + * Copyright (C) 2005-2014 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -328,6 +328,35 @@ int plugin_unregister_notification (const char *name); * function. */ int plugin_dispatch_values (value_list_t const *vl); + +/* + * NAME + * plugin_dispatch_multivalue + * + * SYNOPSIS + * plugin_dispatch_multivalue (vl, 1, + * "free", 42.0, + * "used", 58.0, + * NULL); + * + * DESCRIPTION + * Takes a list of type instances and values and dispatches that in a batch, + * making sure that all values have the same time stamp. If "store_percentage" + * is set to true, the "type" is set to "percent" and a percentage is + * calculated and dispatched, rather than the absolute values. Values that are + * NaN are dispatched as NaN and will not influence the total. + * + * The variadic arguments is a list of type_instance / gauge pairs, that are + * interpreted as type "char const *" and "gauge_t". The last argument must be + * a NULL pointer to signal end-of-list. + * + * RETURNS + * The number of values it failed to dispatch (zero on success). + */ +__attribute__((sentinel)) +int plugin_dispatch_multivalue (value_list_t const *vl, + _Bool store_percentage, ...); + int plugin_dispatch_missing (const value_list_t *vl); int plugin_dispatch_notification (const notification_t *notif);