1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-20 07:38:40 +02:00
openwrt-packages/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch
Hannu Nyman 08d759f14a collectd: update to 5.9.0
Update collectd to version 5.9.0

* remove backported upstream patches (sensors, modbus)
* remove lua patch that has been been implemented upstream
  (See collectd PR 3144)
* refresh patches and accommodate into upstream path changes
* place the 'stations' datatype for iwinfo in alpbetically
  correct place in types.db
* add libmnl dependency to 'processes' plugin required for the
  new Linux process Delay Accounting capability.
  (Alternatively the capability & requirement might be patched away
   in Makefile.am, HAVE_LIBTASKSTATS from collectd_4ea7a572)

* new plugins (disabled): ampq1, gpu_nvidia, pcie_errors,
                          write_stackdriver, write_syslog

compile-tested: ar71xx/WNDR3700 (all plugins)
run-tested: ar71xx/WNDR3700 (selected plugins)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-06-16 22:18:04 +03:00

56 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,
@@ -944,6 +947,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/rrdcreate.c
+++ b/src/utils/rrdcreate/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/rrdcreate.h
+++ b/src/utils/rrdcreate/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;