if (ds->ds[i].type == DS_TYPE_GAUGE)
status = ssnprintf (str_ptr, str_len,
- ",%f", vl->values[i].gauge);
+ ","GAUGE_FORMAT, vl->values[i].gauge);
else if (store_rates) {
if (rates == NULL)
rates = uc_get_rate (ds, vl);
":%llu", vl->values[i].counter);
else if (ds->ds[i].type == DS_TYPE_GAUGE)
status = ssnprintf (buffer + offset, buffer_len - offset,
- ":%lf", vl->values[i].gauge);
+ ":"GAUGE_FORMAT, vl->values[i].gauge);
else if (ds->ds[i].type == DS_TYPE_DERIVE)
status = ssnprintf (buffer + offset, buffer_len - offset,
":%"PRIi64, vl->values[i].derive);
(unsigned) tt, vl->values[0].derive);
break;
case DS_TYPE_GAUGE:
- status = ssnprintf (buffer, buffer_len, "%u:%lf",
+ status = ssnprintf (buffer, buffer_len, "%u:"GAUGE_FORMAT,
(unsigned) tt, vl->values[0].gauge);
break;
case DS_TYPE_COUNTER:
/* If this is a gauge value, use the current value. */
if (ds->ds[i].type == DS_TYPE_GAUGE)
ssnprintf (value_str, sizeof (value_str),
- "%g", (double) vl->values[i].gauge);
+ GAUGE_FORMAT, (double) vl->values[i].gauge);
/* If it's a counter, try to use the current rate. This may fail, if the
* value has been renamed. */
else if (rates != NULL)
ssnprintf (value_str, sizeof (value_str),
- "%g", (double) rates[i]);
+ GAUGE_FORMAT, (double) rates[i]);
/* Since we don't know any better, use the string `unknown'. */
else
sstrncpy (value_str, "unknown", sizeof (value_str));
} while (0)
if (ds->ds[ds_num].type == DS_TYPE_GAUGE)
- BUFFER_ADD ("%f", vl->values[ds_num].gauge);
+ BUFFER_ADD (GAUGE_FORMAT, vl->values[ds_num].gauge);
else if (rates != NULL)
BUFFER_ADD ("%f", rates[ds_num]);
else if (ds->ds[ds_num].type == DS_TYPE_COUNTER)
if (ds->ds[i].type == DS_TYPE_COUNTER)
APPEND ("%llu", vl->values[i].counter);
else if (ds->ds[i].type == DS_TYPE_GAUGE)
- APPEND ("%g", vl->values[i].gauge);
+ APPEND (GAUGE_FORMAT, vl->values[i].gauge);
else if (ds->ds[i].type == DS_TYPE_DERIVE)
APPEND ("%"PRIi64, vl->values[i].derive);
else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)