This is called from the curl and memcachec plugins. Previously, gauge
average, minimum and maximum values were calculated since the start of
the daemon, rather than per-interval. This is not the documented
functionality.
Fixes: #663
}
cc_submit (wp, wm, mv);
+ match_value_reset (mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
return (0);
}
cmc_submit (wp, wm, mv);
+ match_value_reset (mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
sfree (wp->buffer);
/**
* collectd - src/utils_match.c
- * Copyright (C) 2008 Florian octo Forster
+ * Copyright (C) 2008-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
return (obj);
} /* cu_match_t *match_create_simple */
+void match_value_reset (cu_match_value_t *mv)
+{
+ if (mv == NULL)
+ return;
+
+ if (mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE)
+ {
+ mv->value.gauge = NAN;
+ mv->values_num = 0;
+ }
+} /* }}} void match_value_reset */
+
void match_destroy (cu_match_t *obj)
{
if (obj == NULL)
/**
* collectd - src/utils_match.h
- * Copyright (C) 2008 Florian octo Forster
+ * Copyright (C) 2008-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
/*
* NAME
+ * match_value_reset
+ *
+ * DESCRIPTION
+ * Resets the internal state, if applicable. This function must be called
+ * after each iteration for "simple" matches, usually after dispatching the
+ * metrics.
+ */
+void match_value_reset (cu_match_value_t *mv);
+
+/*
+ * NAME
* match_destroy
*
* DESCRIPTION