From: Marc Fournier Date: Fri, 26 Jun 2015 06:09:47 +0000 (+0200) Subject: Merge branch 'collectd-5.5' X-Git-Tag: collectd-5.6.0~668 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3b227016c5e2126d5064c19d29ab79f13a187b39;p=collectd.git Merge branch 'collectd-5.5' Conflicts: src/write_redis.c --- 3b227016c5e2126d5064c19d29ab79f13a187b39 diff --cc src/write_redis.c index 909f51d5,2a6f9124..fa58ad2a --- a/src/write_redis.c +++ b/src/write_redis.c @@@ -141,14 -134,19 +141,21 @@@ static int wr_write (const data_set_t * } 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); + /* 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 collectd/values %s", ident); + 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);