From: Florian Forster Date: Mon, 5 Sep 2016 13:45:19 +0000 (+0200) Subject: plugin_dispatch_multivalue: Submit NAN when computing percantage of an empty set. X-Git-Tag: collectd-5.6.0~3^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c2349cf65ba6ddf9517def5ab1f73706f5ce8e01;p=collectd.git plugin_dispatch_multivalue: Submit NAN when computing percantage of an empty set. --- diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 1deabba3..a8e6ca13 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -2273,7 +2273,7 @@ int plugin_dispatch_multivalue (value_list_t const *template, /* {{{ */ case DS_TYPE_GAUGE: vl->values[0].gauge = va_arg (ap, gauge_t); if (store_percentage) - vl->values[0].gauge *= sum ? (100.0 / sum) : 0; + vl->values[0].gauge *= sum ? (100.0 / sum) : NAN; break; case DS_TYPE_ABSOLUTE: vl->values[0].absolute = va_arg (ap, absolute_t);