]> arthur.barton.de Git - netdata.git/blob - src/health.h
all required system headers in common.h; some progress on health variables
[netdata.git] / src / health.h
1 #ifndef NETDATA_HEALTH_H
2 #define NETDATA_HEALTH_H
3
4 extern int rrdvar_compare(void *a, void *b);
5
6 /*
7  * RRDVAR
8  * a variable
9  *
10  * There are 4 scopes: local (chart), context, host and global variables
11  *
12  * Standard global variables:
13  *  $now
14  *
15  * Standard host variables:
16  *  - none -
17  *
18  * Standard context variables:
19  *  - none -
20  *
21  * Standard local variables:
22  *  $last_updated
23  *  $last_collected_value
24  *  $last_value
25  *
26  */
27
28 typedef struct rrdvar {
29     avl avl;
30
31     char *name;
32     uint32_t hash;
33
34     calculated_number *value;
35
36     time_t last_updated;
37 } RRDVAR;
38
39 typedef struct rrdcalc {
40     avl avl;
41
42     int group;          // grouping method: average, max, etc.
43     int before;         // ending point in time-series
44     int after;          // starting point in time-series
45     int update_every;   // update frequency for the calculation
46
47     const char *name;
48     calculated_number value;
49
50     RRDVAR *local;
51     RRDVAR *context;
52     RRDVAR *host;
53
54     struct rrdcalc *next;
55     struct rrdcalc *prev;
56 } RRDCALC;
57
58 #endif //NETDATA_HEALTH_H