1 #ifndef NETDATA_HEALTH_H
2 #define NETDATA_HEALTH_H
4 extern int rrdvar_compare(void *a, void *b);
10 * There are 4 scopes: local (chart), context, host and global variables
12 * Standard global variables:
15 * Standard host variables:
18 * Standard context variables:
21 * Standard local variables:
23 * $last_collected_value
28 #define RRDVAR_TYPE_CALCULATED 1
29 #define RRDVAR_TYPE_TIME_T 2
30 #define RRDVAR_TYPE_COLLECTED 3
31 #define RRDVAR_TYPE_TOTAL 4
33 // the variables as stored in the variables indexes
34 typedef struct rrdvar {
46 // variables linked to charts
47 typedef struct rrdsetvar {
48 char *fullid; // chart type.chart id.variable
51 char *fullname; // chart type.chart name.variable
52 uint32_t hash_fullname;
54 char *variable; // variable
55 uint32_t hash_variable;
68 struct rrdset *rrdset;
70 struct rrdsetvar *next;
74 // variables linked to dimensions
75 typedef struct rrddimvar {
79 char *id; // dimension id
82 char *name; // dimension name
85 char *fullidid; // chart type.chart id.dimension id
86 uint32_t hash_fullidid;
88 char *fullidname; // chart type.chart id.dimension name
89 uint32_t hash_fullidname;
91 char *fullnameid; // chart type.chart name.dimension id
92 uint32_t hash_fullnameid;
94 char *fullnamename; // chart type.chart name.dimension name
95 uint32_t hash_fullnamename;
105 RRDVAR *context_fullidid;
106 RRDVAR *context_fullidname;
107 RRDVAR *context_fullnameid;
108 RRDVAR *context_fullnamename;
110 RRDVAR *host_fullidid;
111 RRDVAR *host_fullidname;
112 RRDVAR *host_fullnameid;
113 RRDVAR *host_fullnamename;
115 struct rrddim *rrddim;
117 struct rrddimvar *next;
120 typedef struct rrdcalc {
123 int group; // grouping method: average, max, etc.
124 int before; // ending point in time-series
125 int after; // starting point in time-series
126 int update_every; // update frequency for the calculation
129 calculated_number value;
135 struct rrdcalc *next;
136 struct rrdcalc *prev;
141 extern void rrdsetvar_rename_all(RRDSET *st);
142 extern RRDSETVAR *rrdsetvar_create(RRDSET *st, const char *variable, int type, void *value, uint32_t options);
143 extern void rrdsetvar_free(RRDSETVAR *rs);
145 extern void rrddimvar_rename_all(RRDDIM *rd);
146 extern RRDDIMVAR *rrddimvar_create(RRDDIM *rd, int type, const char *prefix, const char *suffix, void *value, uint32_t options);
147 extern void rrddimvar_free(RRDDIMVAR *rs);
149 #endif //NETDATA_HEALTH_H