summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7e79fd8)
raw | patch | inline | side by side (parent: 7e79fd8)
author | Florian Forster <octo@collectd.org> | |
Sat, 10 Nov 2012 08:51:24 +0000 (09:51 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 10 Nov 2012 08:58:20 +0000 (09:58 +0100) |
src/collectd.conf.pod | patch | blob | history | |
src/rrdcached.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 25a6c06ec8f192129b973d93c0a43268d3ec3949..9a67068194121ed089e5d761c48294e2617b495f 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
Bottom line is, set this no smaller than the width of you graphs in pixels. The
default is 1200.
+=item B<RRATimespan> I<Seconds>
+
+Adds an RRA-timespan, given in seconds. Use this option multiple times to have
+more then one RRA. If this option is never used, the built-in default of (3600,
+86400, 604800, 2678400, 31622400) is used.
+
+For more information on how RRA-sizes are calculated see B<RRARows> above.
+
=back
=head2 Plugin C<rrdtool>
diff --git a/src/rrdcached.c b/src/rrdcached.c
index a3dff3e96e0676a041dae8b953c945720a257bd1..3731d01084eb5ee8a4137bb09ca361ccc6230635 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
return (0);
} /* int rc_config_get_int_positive */
+static int rc_config_add_timespan (int timespan)
+{
+ int *tmp;
+
+ if (timespan <= 0)
+ return (EINVAL);
+
+ tmp = realloc (rrdcreate_config.timespans,
+ sizeof (*rrdcreate_config.timespans)
+ * (rrdcreate_config.timespans_num + 1));
+ if (tmp == NULL)
+ return (ENOMEM);
+ rrdcreate_config.timespans = tmp;
+
+ rrdcreate_config.timespans[rrdcreate_config.timespans_num] = timespan;
+ rrdcreate_config.timespans_num++;
+
+ return (0);
+} /* int rc_config_add_timespan */
+
static int rc_config (oconfig_item_t *ci)
{
int i;
status = rc_config_get_int_positive (child, &rrdcreate_config.heartbeat);
else if (strcasecmp ("RRARows", key) == 0)
status = rc_config_get_int_positive (child, &rrdcreate_config.rrarows);
+ else if (strcasecmp ("RRATimespan", key) == 0)
+ {
+ int tmp = -1;
+ status = rc_config_get_int_positive (child, &tmp);
+ if (status == 0)
+ status = rc_config_add_timespan (tmp);
+ }
else
{
WARNING ("rrdcached plugin: Ignoring invalid option %s.", key);