rrdcached plugin: changed time format to no longer lose microseconds when sending...
authorBrian ONeill <btoneill@walleyesoftware.com>
Fri, 8 Feb 2019 16:41:18 +0000 (11:41 -0500)
committerFlorian Forster <octo@collectd.org>
Wed, 20 Feb 2019 08:21:07 +0000 (09:21 +0100)
See https://lists.oetiker.ch/pipermail/rrd-developers/2003-March/001007.html for we want this

src/rrdcached.c

index 125a317..d254714 100644 (file)
@@ -66,8 +66,8 @@ static int value_list_to_string(char *buffer, int buffer_len,
 
   memset(buffer, '\0', buffer_len);
 
-  time_t t = CDTIME_T_TO_TIME_T(vl->time);
-  int status = snprintf(buffer, buffer_len, "%lu", (unsigned long)t);
+  double t = CDTIME_T_TO_DOUBLE(vl->time);
+  int status = snprintf(buffer, buffer_len, "%f", t);
   if ((status < 1) || (status >= buffer_len))
     return -1;
   int offset = status;