Code

write_redis: re-add colon dropped in b7984797
authorMarc Fournier <marc.fournier@camptocamp.com>
Sat, 8 Nov 2014 23:16:11 +0000 (00:16 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Mon, 10 Nov 2014 06:45:23 +0000 (07:45 +0100)
When running f3706b0b87, the following command gets sent to redis:
  "ZADD" "collectd/hostname/entropy/entropy" "1415487432.000000" "1415487432:932"
Meaning the value actually stored, and later returned by redis is:
"<timstamp>:<value>".

b7984797 accidentally dropped the comma separating the timestamp and the
value, which leads the plugin to store a somewhat confusing value in
redis:
  "ZADD" "collectd/hostname/entropy/entropy" "1415487432.000000" "1415487432932"

src/write_redis.c

index 1b127451309bfe902a40a5d68fa33b7e49fe428a..5ed95fb9b2bf5c12a7c6a404690bbf9ab00ab59a 100644 (file)
@@ -86,7 +86,7 @@ static int wr_write (const data_set_t *ds, /* {{{ */
   }                                                                  \
 } while (0)
 
-  APPEND ("%lu", (unsigned long) vl->time);
+  APPEND ("%lu:", (unsigned long) vl->time);
   for (i = 0; i < ds->ds_num; i++)
   {
     if (ds->ds[i].type == DS_TYPE_COUNTER)