author | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 26 Jun 2015 06:09:47 +0000 (08:09 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 26 Jun 2015 06:09:47 +0000 (08:09 +0200) |
Conflicts:
src/write_redis.c
src/write_redis.c
1 | 2 | |||
---|---|---|---|---|
src/write_redis.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/write_redis.c
index 909f51d51aa23ff396da9c259430618efd45043b,2a6f9124aee0f9a66e3c6a004d8456442d7a067b..fa58ad2ace61667322f606a08b380bdb63b7b188
--- 1/src/write_redis.c
--- 2/src/write_redis.c
+++ b/src/write_redis.c
}
rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value);
- if (rr==NULL)
+ if (rr == NULL)
WARNING("ZADD command error. key:%s message:%s", key, node->conn->errstr);
+ else
+ freeReplyObject (rr);
- rr = redisCommand (node->conn, "SADD collectd/values %s", ident);
+ /* TODO(octo): This is more overhead than necessary. Use the cache and
+ * metadata to determine if it is a new metric and call SADD only once for
+ * each metric. */
+ rr = redisCommand (node->conn, "SADD %svalues %s",
+ (node->prefix != NULL) ? node->prefix : REDIS_DEFAULT_PREFIX,
+ ident);
if (rr==NULL)
WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr);
+ else
+ freeReplyObject (rr);
pthread_mutex_unlock (&node->lock);