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