rrddimvar.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_RRDDIMVAR_H
  3. #define NETDATA_RRDDIMVAR_H 1
  4. #include "rrd.h"
  5. // variables linked to individual dimensions
  6. // We link variables to point the values that are already
  7. // calculated / processed by the normal data collection process
  8. // This means, there will be no speed penalty for using
  9. // these variables
  10. struct rrddimvar {
  11. char *prefix;
  12. char *suffix;
  13. char *key_id; // dimension id
  14. char *key_name; // dimension name
  15. char *key_contextid; // context + dimension id
  16. char *key_contextname; // context + dimension name
  17. char *key_fullidid; // chart type.chart id + dimension id
  18. char *key_fullidname; // chart type.chart id + dimension name
  19. char *key_fullnameid; // chart type.chart name + dimension id
  20. char *key_fullnamename; // chart type.chart name + dimension name
  21. RRDVAR_TYPE type;
  22. void *value;
  23. RRDVAR_OPTIONS options;
  24. RRDVAR *var_local_id;
  25. RRDVAR *var_local_name;
  26. RRDVAR *var_family_id;
  27. RRDVAR *var_family_name;
  28. RRDVAR *var_family_contextid;
  29. RRDVAR *var_family_contextname;
  30. RRDVAR *var_host_chartidid;
  31. RRDVAR *var_host_chartidname;
  32. RRDVAR *var_host_chartnameid;
  33. RRDVAR *var_host_chartnamename;
  34. struct rrddim *rrddim;
  35. struct rrddimvar *next;
  36. };
  37. extern void rrddimvar_rename_all(RRDDIM *rd);
  38. extern RRDDIMVAR *rrddimvar_create(RRDDIM *rd, RRDVAR_TYPE type, const char *prefix, const char *suffix, void *value, RRDVAR_OPTIONS options);
  39. extern void rrddimvar_free(RRDDIMVAR *rs);
  40. #endif //NETDATA_RRDDIMVAR_H