summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b798479)
raw | patch | inline | side by side (parent: b798479)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 17 Aug 2010 14:45:42 +0000 (16:45 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 17 Aug 2010 14:45:42 +0000 (16:45 +0200) |
This should make it easy for front-ends to discover available metrics.
src/write_redis.c | patch | blob | history |
diff --git a/src/write_redis.c b/src/write_redis.c
index c995a906ed2399c0c6413f83300d96f493a68e16..58f2cae3e28dc02b3a9fad6bcbb80171230631a3 100644 (file)
--- a/src/write_redis.c
+++ b/src/write_redis.c
user_data_t *ud)
{
wr_node_t *node = ud->data;
+ char ident[512];
char key[512];
char value[512];
size_t value_size;
int status;
int i;
- status = FORMAT_VL (value, sizeof (value), vl);
+ status = FORMAT_VL (ident, sizeof (ident), vl);
if (status != 0)
return (status);
- ssnprintf (key, sizeof (key), "collectd/%s", value);
+ ssnprintf (key, sizeof (key), "collectd/%s", ident);
memset (value, 0, sizeof (value));
value_size = sizeof (value);
assert (node->conn != NULL);
status = credis_zadd (node->conn, key, (double) vl->time, value);
+ credis_sadd (node->conn, "collectd/values", ident);
+
pthread_mutex_unlock (&node->lock);
return (0);