summaryrefslogtreecommitdiffstats
path: root/src/health.h
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@tsaousis.gr>2016-08-06 03:52:03 +0300
committerCosta Tsaousis <costa@tsaousis.gr>2016-08-06 03:52:03 +0300
commitf399edf7dffc296873c14fa0fca3f593674b291a (patch)
treea64b3df940676395d81e171d733461ef355cc542 /src/health.h
parent929fcc7b073a75c861a3d9025859bcfeffaa7875 (diff)
all required system headers in common.h; some progress on health variables
Diffstat (limited to 'src/health.h')
-rw-r--r--src/health.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/health.h b/src/health.h
new file mode 100644
index 0000000000..d4b55a5d02
--- /dev/null
+++ b/src/health.h
@@ -0,0 +1,58 @@
+#ifndef NETDATA_HEALTH_H
+#define NETDATA_HEALTH_H
+
+extern int rrdvar_compare(void *a, void *b);
+
+/*
+ * RRDVAR
+ * a variable
+ *
+ * There are 4 scopes: local (chart), context, host and global variables
+ *
+ * Standard global variables:
+ * $now
+ *
+ * Standard host variables:
+ * - none -
+ *
+ * Standard context variables:
+ * - none -
+ *
+ * Standard local variables:
+ * $last_updated
+ * $last_collected_value
+ * $last_value
+ *
+ */
+
+typedef struct rrdvar {
+ avl avl;
+
+ char *name;
+ uint32_t hash;
+
+ calculated_number *value;
+
+ time_t last_updated;
+} RRDVAR;
+
+typedef struct rrdcalc {
+ avl avl;
+
+ int group; // grouping method: average, max, etc.
+ int before; // ending point in time-series
+ int after; // starting point in time-series
+ int update_every; // update frequency for the calculation
+
+ const char *name;
+ calculated_number value;
+
+ RRDVAR *local;
+ RRDVAR *context;
+ RRDVAR *host;
+
+ struct rrdcalc *next;
+ struct rrdcalc *prev;
+} RRDCALC;
+
+#endif //NETDATA_HEALTH_H