- /* "credis_zadd" doesn't handle a NULL pointer gracefully, so I'd rather
- * have a meaningful assertion message than a normal segmentation fault. */
- assert (node->conn != NULL);
- status = credis_zadd (node->conn, key, (double) vl->time, value);
-
- credis_sadd (node->conn, "collectd/values", ident);
+ rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value);
+ 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);
+ if (rr==NULL)
+ WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr);
+ else
+ freeReplyObject (rr);