libs/libgd: Update to 2.2.5
[feed/packages.git] / utils / collectd / patches / 100-rrdtool-add-rrasingle-option.patch
1 --- a/src/rrdtool.c
2 +++ b/src/rrdtool.c
3 @@ -61,6 +61,7 @@ typedef struct rrd_queue_s rrd_queue_t;
4 static const char *config_keys[] = {
5 "CacheTimeout", "CacheFlush", "CreateFilesAsync", "DataDir",
6 "StepSize", "HeartBeat", "RRARows", "RRATimespan",
7 + "RRASingle",
8 "XFF", "WritesPerSecond", "RandomTimeout"};
9 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
10
11 @@ -78,6 +79,8 @@ static rrdcreate_config_t rrdcreate_conf
12 /* timespans = */ NULL,
13 /* timespans_num = */ 0,
14
15 + /* rrasingle = */ 0,
16 +
17 /* consolidation_functions = */ NULL,
18 /* consolidation_functions_num = */ 0,
19
20 @@ -971,6 +974,12 @@ static int rrd_config(const char *key, c
21 /* compar = */ rrd_compare_numeric);
22
23 free(value_copy);
24 + } else if (strcasecmp ("RRASingle", key) == 0) {
25 + if (IS_TRUE (value))
26 + {
27 + rrdcreate_config.rrasingle = 1;
28 + NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
29 + }
30 } else if (strcasecmp("XFF", key) == 0) {
31 double tmp = atof(value);
32 if ((tmp < 0.0) || (tmp >= 1.0)) {
33 --- a/src/utils_rrdcreate.c
34 +++ b/src/utils_rrdcreate.c
35 @@ -180,6 +180,9 @@ static int rra_get(char ***ret, const va
36 rts_num = rra_timespans_num;
37 }
38
39 + if (cfg->rrasingle)
40 + rra_types_num = 1;
41 +
42 rra_max = rts_num * rra_types_num;
43 assert(rra_max > 0);
44
45 --- a/src/utils_rrdcreate.h
46 +++ b/src/utils_rrdcreate.h
47 @@ -40,6 +40,8 @@ struct rrdcreate_config_s {
48 int *timespans;
49 size_t timespans_num;
50
51 + int rrasingle;
52 +
53 char **consolidation_functions;
54 size_t consolidation_functions_num;
55