index e30ff91bc7f17e6a9983a9215e53497ea8c78794..caa3e7e302c000c342775e64665f5aa46ac3c6b0 100644 (file)
#include "collectd.h"
#include "common.h"
-#include "utils_cache.h"
#include "filter_chain.h"
/*
{
mec_match_t *m;
- m = (mec_match_t *) malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- ERROR ("mec_create: malloc failed.");
+ ERROR ("mec_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
if (ci->children_num != 0)
{
for (i = 0; i < ds->ds_num; i++)
{
- if (ds->ds[i].type != DS_TYPE_COUNTER)
+ if ((ds->ds[i].type != DS_TYPE_DERIVE)
+ && (ds->ds[i].type != DS_TYPE_COUNTER))
continue;
num_counters++;
- if (vl->values[i].counter == 0)
+ if (((ds->ds[i].type == DS_TYPE_DERIVE) && (vl->values[i].derive == 0))
+ || ((ds->ds[i].type == DS_TYPE_COUNTER) && (vl->values[i].counter == 0)))
num_empty++;
}