rrdsetvar.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_RRDSETVAR_H
  3. #define NETDATA_RRDSETVAR_H 1
  4. #include "rrd.h"
  5. // variables linked to charts
  6. // We link variables to point to 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 rrdsetvar {
  11. char *variable; // variable name
  12. uint32_t hash; // variable name hash
  13. char *key_fullid; // chart type.chart id.variable
  14. char *key_fullname; // chart type.chart name.variable
  15. RRDVAR_TYPE type;
  16. void *value;
  17. RRDVAR_OPTIONS options;
  18. RRDVAR *var_local;
  19. RRDVAR *var_family;
  20. RRDVAR *var_host;
  21. RRDVAR *var_family_name;
  22. RRDVAR *var_host_name;
  23. struct rrdset *rrdset;
  24. struct rrdsetvar *next;
  25. };
  26. extern RRDSETVAR *rrdsetvar_custom_chart_variable_create(RRDSET *st, const char *name);
  27. extern void rrdsetvar_custom_chart_variable_set(RRDSETVAR *rv, NETDATA_DOUBLE value);
  28. extern void rrdsetvar_rename_all(RRDSET *st);
  29. extern RRDSETVAR *rrdsetvar_create(RRDSET *st, const char *variable, RRDVAR_TYPE type, void *value, RRDVAR_OPTIONS options);
  30. extern void rrdsetvar_free(RRDSETVAR *rs);
  31. #endif //NETDATA_RRDSETVAR_H