if (ds->ds[i].type == DS_TYPE_GAUGE)
{
if(isfinite (vl->values[i].gauge))
- BUFFER_ADD ("%g", vl->values[i].gauge);
+ BUFFER_ADD (JSON_GAUGE_FORMAT, vl->values[i].gauge);
else
BUFFER_ADD ("null");
}
}
if(isfinite (rates[i]))
- BUFFER_ADD ("%g", rates[i]);
+ BUFFER_ADD (JSON_GAUGE_FORMAT, rates[i]);
else
BUFFER_ADD ("null");
}
#include "collectd.h"
#include "plugin.h"
+#ifndef JSON_GAUGE_FORMAT
+# define JSON_GAUGE_FORMAT "%.15g"
+#endif
+
int format_json_initialize (char *buffer,
size_t *ret_buffer_fill, size_t *ret_buffer_free);
int format_json_value_list (char *buffer,