#include "utils_cache.h"
#include "utils_time.h"
+#include <math.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
#if HAVE_YAJL_YAJL_VERSION_H
/* for cumulative metrics, the interval must not be zero. */
return EAGAIN;
}
+ if (ds_type == DS_TYPE_GAUGE) {
+ double d = (double)vl->values[ds_index].gauge;
+ if (isnan(d) || isinf(d)) {
+ return EAGAIN;
+ }
+ }
yajl_gen_map_open(gen);
for (size_t i = 0; i < ds->ds_num; i++) {
int status = format_time_series(out->gen, ds, vl, i, out->res);
if (status == EAGAIN) {
- /* first instance of a cumulative metric */
+ /* first instance of a cumulative metric or NaN value */
continue;
}
if (status != 0) {