packages/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch
Thomas Huehn 55e530747f collectd: upgrade package collectd to version 5.8.0
This patch upgrades the collectd package from 5.7.2 to 5.8.2.
All openwrt patches got either updated or deleted in case they
are already included into upstream collectd.
The new collectd 5.8.0 package compiles and got tested on current
lede trunk with latest luci on an PCengines APU. All default plugins
(enabled via Openwrt  Makefile) - so also iwinfo - are running fine
with the new version.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>

Amended with the following changes:

* preserve git file history by avoiding unnecessary patch renames
* mark new plugins introduced with 5.8 branch as disabled

Compile tested all plugins with ipq806x

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-12-06 10:44:11 +02:00

55 lines
1.6 KiB
Diff

--- a/src/rrdtool.c
+++ b/src/rrdtool.c
@@ -60,6 +60,7 @@ typedef struct rrd_queue_s rrd_queue_t;
static const char *config_keys[] = {
"CacheTimeout", "CacheFlush", "CreateFilesAsync", "DataDir",
"StepSize", "HeartBeat", "RRARows", "RRATimespan",
+ "RRASingle",
"XFF", "WritesPerSecond", "RandomTimeout"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
@@ -77,6 +78,8 @@ static rrdcreate_config_t rrdcreate_conf
/* timespans = */ NULL,
/* timespans_num = */ 0,
+ /* rrasingle = */ 0,
+
/* consolidation_functions = */ NULL,
/* consolidation_functions_num = */ 0,
@@ -950,6 +953,12 @@ static int rrd_config(const char *key, c
/* compar = */ rrd_compare_numeric);
free(value_copy);
+ } else if (strcasecmp ("RRASingle", key) == 0) {
+ if (IS_TRUE (value))
+ {
+ rrdcreate_config.rrasingle = 1;
+ NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
+ }
} else if (strcasecmp("XFF", key) == 0) {
double tmp = atof(value);
if ((tmp < 0.0) || (tmp >= 1.0)) {
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
@@ -180,6 +180,9 @@ static int rra_get(char ***ret, const va
rts_num = rra_timespans_num;
}
+ if (cfg->rrasingle)
+ rra_types_num = 1;
+
rra_max = rts_num * rra_types_num;
assert(rra_max > 0);
--- a/src/utils_rrdcreate.h
+++ b/src/utils_rrdcreate.h
@@ -40,6 +40,8 @@ struct rrdcreate_config_s {
int *timespans;
size_t timespans_num;
+ int rrasingle;
+
char **consolidation_functions;
size_t consolidation_functions_num;