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.

57 lines
1.3 KiB

  1. --- a/src/rrdtool.c
  2. +++ b/src/rrdtool.c
  3. @@ -80,6 +80,7 @@ static const char *config_keys[] =
  4. "HeartBeat",
  5. "RRARows",
  6. "RRATimespan",
  7. + "RRASingle",
  8. "XFF",
  9. "WritesPerSecond",
  10. "RandomTimeout"
  11. @@ -101,6 +102,8 @@ static rrdcreate_config_t rrdcreate_conf
  12. /* timespans = */ NULL,
  13. /* timespans_num = */ 0,
  14. + /* rrasingle = */ 0,
  15. +
  16. /* consolidation_functions = */ NULL,
  17. /* consolidation_functions_num = */ 0
  18. };
  19. @@ -1027,6 +1030,14 @@ static int rrd_config (const char *key,
  20. free (value_copy);
  21. }
  22. + else if (strcasecmp ("RRASingle", key) == 0)
  23. + {
  24. + if (IS_TRUE (value))
  25. + {
  26. + rrdcreate_config.rrasingle = 1;
  27. + NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
  28. + }
  29. + }
  30. else if (strcasecmp ("XFF", key) == 0)
  31. {
  32. double tmp = atof (value);
  33. --- a/src/utils_rrdcreate.c
  34. +++ b/src/utils_rrdcreate.c
  35. @@ -122,6 +122,9 @@ static int rra_get (char ***ret, const v
  36. rts_num = rra_timespans_num;
  37. }
  38. + if (cfg->rrasingle)
  39. + rra_types_num = 1;
  40. +
  41. rra_max = rts_num * rra_types_num;
  42. if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL)
  43. --- a/src/utils_rrdcreate.h
  44. +++ b/src/utils_rrdcreate.h
  45. @@ -36,6 +36,8 @@ struct rrdcreate_config_s
  46. int *timespans;
  47. size_t timespans_num;
  48. + int rrasingle;
  49. +
  50. char **consolidation_functions;
  51. size_t consolidation_functions_num;
  52. };