/**
* collectd - src/utils_match.c
- * Copyright (C) 2008 Florian octo Forster
+ * Copyright (C) 2008-2014 Florian octo Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
gauge_t value;
char *endptr = NULL;
+ if (data->ds_type & UTILS_MATCH_CF_GAUGE_INC)
+ {
+ data->value.gauge = isnan (data->value.gauge) ? 1 : data->value.gauge + 1;
+ data->values_num++;
+ return(0);
+ }
+
if (matches_num < 2)
return (-1);
if (data->value.gauge < value)
data->value.gauge = value;
}
+ else if (data->ds_type & UTILS_MATCH_CF_GAUGE_ADD)
+ {
+ data->value.gauge += value;
+ }
else
{
ERROR ("utils_match: default_callback: obj->ds_type is invalid!");
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)