projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
18dc4a8
)
write_redis plugin: Call freeReplyObject() for each redisReply.
author
Florian Forster
<octo@collectd.org>
Thu, 25 Jun 2015 20:18:27 +0000
(22:18 +0200)
committer
Florian Forster
<octo@collectd.org>
Thu, 25 Jun 2015 20:19:57 +0000
(22:19 +0200)
src/write_redis.c
patch
|
blob
|
history
diff --git
a/src/write_redis.c
b/src/write_redis.c
index
02663c6
..
2a6f912
100644
(file)
--- a/
src/write_redis.c
+++ b/
src/write_redis.c
@@
-134,12
+134,19
@@
static int wr_write (const data_set_t *ds, /* {{{ */
}
rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value);
}
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);
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);
if (rr==NULL)
WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr);
rr = redisCommand (node->conn, "SADD collectd/values %s", ident);
if (rr==NULL)
WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr);
+ else
+ freeReplyObject (rr);
pthread_mutex_unlock (&node->lock);
pthread_mutex_unlock (&node->lock);