/**
* collectd - src/write_redis.c
- * Copyright (C) 2010 Florian Forster
+ * Copyright (C) 2010 Florian Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
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);