X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdcached.c;h=728ada459d821f2c7cd4d009e14cdd882e01f59d;hb=0742dc6da5074abaf3bb27c579de12460f7db690;hp=326a8898622179c1ca741ba3d0f710f3a828d161;hpb=9d15d1058b93acb7be041934acfe76548539041a;p=collectd.git diff --git a/src/rrdcached.c b/src/rrdcached.c index 326a8898..728ada45 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -75,7 +75,9 @@ static int value_list_to_string (char *buffer, int buffer_len, for (i = 0; i < ds->ds_num; i++) { if ((ds->ds[i].type != DS_TYPE_COUNTER) - && (ds->ds[i].type != DS_TYPE_GAUGE)) + && (ds->ds[i].type != DS_TYPE_GAUGE) + && (ds->ds[i].type != DS_TYPE_DERIVE) + && (ds->ds[i].type != DS_TYPE_ABSOLUTE)) return (-1); if (ds->ds[i].type == DS_TYPE_COUNTER) @@ -83,10 +85,19 @@ static int value_list_to_string (char *buffer, int buffer_len, status = ssnprintf (buffer + offset, buffer_len - offset, ":%llu", vl->values[i].counter); } - else /* if (ds->ds[i].type == DS_TYPE_GAUGE) */ + else if (ds->ds[i].type == DS_TYPE_GAUGE) { status = ssnprintf (buffer + offset, buffer_len - offset, - ":%lf", vl->values[i].gauge); + ":%f", 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); + } + else /* if (ds->ds[i].type == DS_TYPE_ABSOLUTE) */ { + status = ssnprintf (buffer + offset, buffer_len - offset, + ":%"PRIu64, vl->values[i].absolute); + } if ((status < 1) || (status >= (buffer_len - offset)))