summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a8f581)
raw | patch | inline | side by side (parent: 4a8f581)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 10 Nov 2014 06:58:13 +0000 (07:58 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 10 Nov 2014 07:00:02 +0000 (08:00 +0100) |
The commands getting submitted to redis now look like this:
"ZADD" "collectd/hostname/entropy/entropy" "1415602051.335973024" "1415602051.335973024:823"
"SADD" "collectd/values" "hostname/entropy/entropy"
... which is the same as in the initial implementation, except for the
added decimals in the timestamp (the plugin was developped before
high-precision timestamps support was added to collectd).
"ZADD" "collectd/hostname/entropy/entropy" "1415602051.335973024" "1415602051.335973024:823"
"SADD" "collectd/values" "hostname/entropy/entropy"
... which is the same as in the initial implementation, except for the
added decimals in the timestamp (the plugin was developped before
high-precision timestamps support was added to collectd).
src/write_redis.c | patch | blob | history |
diff --git a/src/write_redis.c b/src/write_redis.c
index 5ed95fb9b2bf5c12a7c6a404690bbf9ab00ab59a..28d475fecbc41e22132cbf984812cdf0b735e27c 100644 (file)
--- a/src/write_redis.c
+++ b/src/write_redis.c
} \
} while (0)
- APPEND ("%lu:", (unsigned long) vl->time);
+ APPEND ("%.9f:", CDTIME_T_TO_DOUBLE(vl->time));
for (i = 0; i < ds->ds_num; i++)
{
if (ds->ds[i].type == DS_TYPE_COUNTER)
}
assert (node->conn != NULL);
- rr = redisCommand (node->conn, "ZADD %b %f %b", key, sizeof (key),
- (double) vl->time, value, sizeof (value));
+ rr = redisCommand (node->conn, "ZADD %s %.9f %s", key,
+ CDTIME_T_TO_DOUBLE(vl->time), value);
if (rr==NULL)
WARNING("ZADD command error. key:%s", key);
- rr = redisCommand (node->conn, "SADD collectd/values %b", ident, sizeof(ident));
+ rr = redisCommand (node->conn, "SADD collectd/values %s", ident);
if (rr==NULL)
WARNING("SADD command error. ident:%s", ident);