X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=utils%2Fcollectd%2Fpatches%2F100-rrdtool-add-rrasingle-option.patch;h=611a729c9db287d7f01aa468020410e1a8f8b068;hp=23c7861cdee8d56f843624dbc2ec6d7c0baca3cb;hb=4c44a1cd796bd46b4e740821e4b9e718c37d3837;hpb=81f721b22a43cffc5608db019cb12823c7facb83 diff --git a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch index 23c7861cde..611a729c9d 100644 --- a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch +++ b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch @@ -1,27 +1,57 @@ -Index: collectd-4.4.2/src/rrdtool.c -=================================================================== ---- collectd-4.4.2.orig/src/rrdtool.c 2008-07-17 19:30:00.000000000 +0200 -+++ collectd-4.4.2/src/rrdtool.c 2008-07-17 19:30:44.000000000 +0200 -@@ -87,6 +87,7 @@ +--- a/src/rrdtool.c ++++ b/src/rrdtool.c +@@ -80,6 +80,7 @@ static const char *config_keys[] = "HeartBeat", "RRARows", "RRATimespan", + "RRASingle", - "XFF" + "XFF", + "WritesPerSecond", + "RandomTimeout" +@@ -101,6 +102,8 @@ static rrdcreate_config_t rrdcreate_conf + /* timespans = */ NULL, + /* timespans_num = */ 0, + ++ /* rrasingle = */ 0, ++ + /* consolidation_functions = */ NULL, + /* consolidation_functions_num = */ 0 }; - static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); -@@ -1077,6 +1078,14 @@ - } - xff = tmp; +@@ -976,6 +979,14 @@ static int rrd_config (const char *key, + + free (value_copy); } + else if (strcasecmp ("RRASingle", key) == 0) + { -+ if (strcasecmp("true", value) == 0) ++ if (IS_TRUE (value)) + { -+ rra_types_num = 1; ++ rrdcreate_config.rrasingle = 1; + NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs"); + } + } - else + else if (strcasecmp ("XFF", key) == 0) { - return (-1); + double tmp = atof (value); +--- a/src/utils_rrdcreate.c ++++ b/src/utils_rrdcreate.c +@@ -122,6 +122,9 @@ static int rra_get (char ***ret, const v + rts_num = rra_timespans_num; + } + ++ if (cfg->rrasingle) ++ rra_types_num = 1; ++ + rra_max = rts_num * rra_types_num; + + if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL) +--- a/src/utils_rrdcreate.h ++++ b/src/utils_rrdcreate.h +@@ -36,6 +36,8 @@ struct rrdcreate_config_s + int *timespans; + size_t timespans_num; + ++ int rrasingle; ++ + char **consolidation_functions; + size_t consolidation_functions_num; + };