summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 49001de)
raw | patch | inline | side by side (parent: 49001de)
author | Brian Kelly <brianpkelly46@gmail.com> | |
Thu, 30 Jul 2015 13:42:36 +0000 (09:42 -0400) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 27 Oct 2015 23:31:01 +0000 (00:31 +0100) |
src/collectd.conf.pod | patch | blob | history | |
src/write_redis.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index a06abe92d3afb12792ac53f1ccc77314948ec7bf..8a508089d2589ba35994f159fef1098d7c128563 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
Timeout 1000
Prefix "collectd/"
Database 1
+ MaxSetSize -1
+ StoreRates true
</Node>
</Plugin>
The B<MaxSetSize> option limits the number of items that the I<Sorted Sets> can
hold. Negative values for I<Items> sets no limit, which is the default behavior.
+=item B<StoreRates> B<true>|B<false>
+
+If set to B<true> (the default), convert counter values to rates. If set to
+B<false> counter values are stored as is, i.e. as an increasing integer number.
+
=back
=head2 Plugin C<write_riemann>
diff --git a/src/write_redis.c b/src/write_redis.c
index fe8994d54011c6ea10e3f0ebca54d87c6dc97721..1eb082fb331cfcb9496658c8e98ef4fb8e5297b4 100644 (file)
--- a/src/write_redis.c
+++ b/src/write_redis.c
char *prefix;
int database;
int max_set_size;
+ _Bool store_rates;
redisContext *conn;
pthread_mutex_t lock;
memset (value, 0, sizeof (value));
value_size = sizeof (value);
value_ptr = &value[0];
- status = format_values (value_ptr, value_size, ds, vl, /* store rates = */ 0);
+ status = format_values (value_ptr, value_size, ds, vl, node->store_rates);
pthread_mutex_lock (&node->lock);
if (status != 0)
return (status);
node->prefix = NULL;
node->database = 0;
node->max_set_size = -1;
+ node->store_rates = 1;
pthread_mutex_init (&node->lock, /* attr = */ NULL);
status = cf_util_get_string_buffer (ci, node->name, sizeof (node->name));
else if (strcasecmp ("MaxSetSize", child->key) == 0) {
status = cf_util_get_int (child, &node->max_set_size);
}
+ else if (strcasecmp ("StoreRates", child->key) == 0) {
+ status = cf_util_get_boolean (child, &node->store_rates);
+ }
else
WARNING ("write_redis plugin: Ignoring unknown config option \"%s\".",
child->key);