summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a02bef)
raw | patch | inline | side by side (parent: 7a02bef)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 14 Nov 2014 21:04:16 +0000 (22:04 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 14 Nov 2014 21:04:16 +0000 (22:04 +0100) |
... as it seems to not be well supported by hiredis 0.10.1 on Debian
7.0, leading to a segfault. Storing the string representation in a
variable instead is the compromise I found to make the plugin work on
this system.
7.0, leading to a segfault. Storing the string representation in a
variable instead is the compromise I found to make the plugin work on
this system.
src/write_redis.c | patch | blob | history |
diff --git a/src/write_redis.c b/src/write_redis.c
index 28d475fecbc41e22132cbf984812cdf0b735e27c..b47650d178149bdc2d3342d669afaf9c2cf94d4c 100644 (file)
--- a/src/write_redis.c
+++ b/src/write_redis.c
char ident[512];
char key[512];
char value[512];
+ char time[24];
size_t value_size;
char *value_ptr;
int status;
if (status != 0)
return (status);
ssnprintf (key, sizeof (key), "collectd/%s", ident);
+ ssnprintf (time, sizeof (time), "%.9f", CDTIME_T_TO_DOUBLE(vl->time));
memset (value, 0, sizeof (value));
value_size = sizeof (value);
} \
} while (0)
- APPEND ("%.9f:", CDTIME_T_TO_DOUBLE(vl->time));
+ APPEND (time);
+ APPEND (":");
+
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 %s %.9f %s", key,
- CDTIME_T_TO_DOUBLE(vl->time), value);
+ rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value);
if (rr==NULL)
WARNING("ZADD command error. key:%s", key);