]> arthur.barton.de Git - netdata.git/blobdiff - src/rrd.h
operational health monitoring - we got alarms! - no notifications yet though
[netdata.git] / src / rrd.h
index d0e3584fe67857a0258825c0936b9580cd4c9bbd..2893d0dfb9e6bb454d16f98608aa3a36a3a2f22b 100644 (file)
--- a/src/rrd.h
+++ b/src/rrd.h
@@ -138,11 +138,13 @@ struct rrddim {
                                                     // this is actual date time we updated the last_collected_value
                                                     // THIS IS DIFFERENT FROM THE SAME MEMBER OF RRDSET
 
-    calculated_number calculated_value;             // the current calculated value, after applying the algorithm
-    calculated_number last_calculated_value;        // the last calculated value
+    calculated_number calculated_value;             // the current calculated value, after applying the algorithm - resets to zero after being used
+    calculated_number last_calculated_value;        // the last calculated value processed
 
-    collected_number collected_value;               // the current value, as collected
-    collected_number last_collected_value;          // the last value that was collected
+    calculated_number last_stored_value;            // the last value as stored in the database (after interpolation)
+
+    collected_number collected_value;               // the current value, as collected - resets to 0 after being used
+    collected_number last_collected_value;          // the last value that was collected, after being processed
 
     // the *_volume members are used to calculate the accuracy of the rounding done by the
     // storage number - they are printed to debug.log when debug is enabled for a set.
@@ -197,10 +199,12 @@ struct rrdset {
 
     char *type;                                     // the type of graph RRD_TYPE_* (a category, for determining graphing options)
     char *family;                                   // grouping sets under the same family
-    char *context;                                  // the template of this data set
     char *title;                                    // title shown to user
     char *units;                                    // units of measurement
 
+    char *context;                                  // the template of this data set
+    uint32_t hash_context;
+
     int chart_type;
 
     int update_every;                               // every how many seconds is this updated?
@@ -256,6 +260,9 @@ struct rrdset {
     // ------------------------------------------------------------------------
     // local variables
 
+    calculated_number green;
+    calculated_number red;
+
     avl_tree_lock variables_root_index;
     RRDSETVAR *variables;
     RRDCALC *calculations;
@@ -298,6 +305,8 @@ struct rrdhost {
     // (charts may or may not exist when these are loaded)
     RRDCALC *calculations;
 
+    RRDCALCTEMPLATE *templates;
+
     // all variable references are linked here
     // RRDVARs may be free'd, so every time this happens
     // we need to find all their references and invalidate them
@@ -308,10 +317,18 @@ extern RRDHOST localhost;
 
 #ifdef NETDATA_INTERNAL_CHECKS
 #define rrdhost_check_wrlock(host) rrdhost_check_wrlock_int(host, __FILE__, __FUNCTION__, __LINE__)
+#define rrdhost_check_rdlock(host) rrdhost_check_rdlock_int(host, __FILE__, __FUNCTION__, __LINE__)
 #else
+#define rrdhost_check_rdlock(host) (void)0
 #define rrdhost_check_wrlock(host) (void)0
 #endif
+
 extern void rrdhost_check_wrlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line);
+extern void rrdhost_check_rdlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line);
+
+extern void rrdhost_rwlock(RRDHOST *host);
+extern void rrdhost_rdlock(RRDHOST *host);
+extern void rrdhost_unlock(RRDHOST *host);
 
 // ----------------------------------------------------------------------------
 // RRD SET functions