You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

  1. --- a/src/rrdtool.c
  2. +++ b/src/rrdtool.c
  3. @@ -60,6 +60,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. @@ -77,6 +78,8 @@ static rrdcreate_config_t rrdcreate_conf
  11. /* timespans = */ NULL,
  12. /* timespans_num = */ 0,
  13. + /* rrasingle = */ 0,
  14. +
  15. /* consolidation_functions = */ NULL,
  16. /* consolidation_functions_num = */ 0,
  17. @@ -944,6 +947,12 @@ static int rrd_config(const char *key, c
  18. /* compar = */ rrd_compare_numeric);
  19. free(value_copy);
  20. + } else if (strcasecmp ("RRASingle", key) == 0) {
  21. + if (IS_TRUE (value))
  22. + {
  23. + rrdcreate_config.rrasingle = 1;
  24. + NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
  25. + }
  26. } else if (strcasecmp("XFF", key) == 0) {
  27. double tmp = atof(value);
  28. if ((tmp < 0.0) || (tmp >= 1.0)) {
  29. --- a/src/utils/rrdcreate/rrdcreate.c
  30. +++ b/src/utils/rrdcreate/rrdcreate.c
  31. @@ -180,6 +180,9 @@ static int rra_get(char ***ret, const va
  32. rts_num = rra_timespans_num;
  33. }
  34. + if (cfg->rrasingle)
  35. + rra_types_num = 1;
  36. +
  37. rra_max = rts_num * rra_types_num;
  38. assert(rra_max > 0);
  39. --- a/src/utils/rrdcreate/rrdcreate.h
  40. +++ b/src/utils/rrdcreate/rrdcreate.h
  41. @@ -40,6 +40,8 @@ struct rrdcreate_config_s {
  42. int *timespans;
  43. size_t timespans_num;
  44. + int rrasingle;
  45. +
  46. char **consolidation_functions;
  47. size_t consolidation_functions_num;