# endif
#endif
+#ifndef GAUGE_FORMAT
+# define GAUGE_FORMAT "%.15g"
+#endif
+
/* Type for time as used by "utils_time.h" */
typedef uint64_t cdtime_t;
for (i = 0; i < ds->ds_num; i++)
{
if (ds->ds[i].type == DS_TYPE_GAUGE)
- BUFFER_ADD (":%f", vl->values[i].gauge);
+ BUFFER_ADD (":"GAUGE_FORMAT, vl->values[i].gauge);
else if (store_rates)
{
if (rates == NULL)
rates = uc_get_rate (ds, vl);
if (rates == NULL)
{
- WARNING ("format_values: "
- "uc_get_rate failed.");
+ WARNING ("format_values: uc_get_rate failed.");
return (-1);
}
- BUFFER_ADD (":%g", rates[i]);
+ BUFFER_ADD (":"GAUGE_FORMAT, rates[i]);
}
else if (ds->ds[i].type == DS_TYPE_COUNTER)
BUFFER_ADD (":%llu", vl->values[i].counter);
BUFFER_ADD (":%"PRIu64, vl->values[i].absolute);
else
{
- ERROR ("format_values plugin: Unknown data source type: %i",
+ ERROR ("format_values: Unknown data source type: %i",
ds->ds[i].type);
sfree (rates);
return (-1);
#include "plugin.h"
#ifndef JSON_GAUGE_FORMAT
-# define JSON_GAUGE_FORMAT "%.15g"
+# define JSON_GAUGE_FORMAT GAUGE_FORMAT
#endif
int format_json_initialize (char *buffer,