]> arthur.barton.de Git - netdata.git/blobdiff - src/rrd.h
nonzero option should return all selected dimensions if they are all zero; fixes...
[netdata.git] / src / rrd.h
index 2893d0dfb9e6bb454d16f98608aa3a36a3a2f22b..4189d36cd43f497b4f7cd643379a6c9b7f66f677 100644 (file)
--- a/src/rrd.h
+++ b/src/rrd.h
@@ -13,7 +13,7 @@ extern int rrd_default_history_entries;
 // set to zero to disable this feature
 extern int rrd_delete_unupdated_dimensions;
 
-#define RRD_ID_LENGTH_MAX 1024
+#define RRD_ID_LENGTH_MAX 400
 
 #define RRDSET_MAGIC        "NETDATA RRD SET FILE V018"
 #define RRDDIMENSION_MAGIC  "NETDATA RRD DIMENSION FILE V018"
@@ -78,17 +78,17 @@ extern const char *rrddim_algorithm_name(int chart_type);
 // ----------------------------------------------------------------------------
 // RRD CONTEXT
 
-struct rrdcontext {
+struct rrdfamily {
     avl avl;
 
-    const char *id;
-    uint32_t hash;
+    const char *family;
+    uint32_t hash_family;
 
     size_t use_count;
 
     avl_tree_lock variables_root_index;
 };
-typedef struct rrdcontext RRDCONTEXT;
+typedef struct rrdfamily RRDFAMILY;
 
 // ----------------------------------------------------------------------------
 // RRD DIMENSION
@@ -124,6 +124,7 @@ struct rrddim {
 
     // FIXME
     // we need the hash_name too!
+    // needed at rrdr_disable_not_selected_dimensions()
 
     uint32_t flags;
 
@@ -244,7 +245,7 @@ struct rrdset {
 
     uint32_t hash_name;                             // a simple hash on the name
 
-    unsigned long long usec_since_last_update;      // the time in microseconds since the last collection of data
+    usec_t usec_since_last_update;                  // the time in microseconds since the last collection of data
 
     struct timeval last_updated;                    // when this data set was last updated (updated every time the rrd_stats_done() function)
     struct timeval last_collected_time;             // when did this data set last collected values
@@ -252,7 +253,7 @@ struct rrdset {
     total_number collected_total;                   // used internally to calculate percentages
     total_number last_collected_total;              // used internally to calculate percentages
 
-    RRDCONTEXT *rrdcontext;
+    RRDFAMILY *rrdfamily;
     struct rrdhost *rrdhost;
 
     struct rrdset *next;                            // linking of rrdsets
@@ -265,7 +266,7 @@ struct rrdset {
 
     avl_tree_lock variables_root_index;
     RRDSETVAR *variables;
-    RRDCALC *calculations;
+    RRDCALC *alarms;
 
     // ------------------------------------------------------------------------
     // members for checking the data when loading from disk
@@ -277,7 +278,7 @@ struct rrdset {
     // ------------------------------------------------------------------------
     // the dimensions
 
-    avl_tree_lock dimensions_index;                     // the root of the dimensions index
+    avl_tree_lock dimensions_index;                 // the root of the dimensions index
     RRDDIM *dimensions;                             // the actual data for every dimension
 
 };
@@ -297,23 +298,20 @@ struct rrdhost {
     avl_tree_lock rrdset_root_index;
     avl_tree_lock rrdset_root_index_name;
 
-    avl_tree_lock rrdcontext_root_index;
+    avl_tree_lock rrdfamily_root_index;
     avl_tree_lock variables_root_index;
 
     // all RRDCALCs are primarily allocated and linked here
     // RRDCALCs may be linked to charts at any point
     // (charts may or may not exist when these are loaded)
-    RRDCALC *calculations;
+    RRDCALC *alarms;
+    ALARM_LOG health_log;
 
     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
-    EVAL_VARIABLE *references;
 };
 typedef struct rrdhost RRDHOST;
 extern RRDHOST localhost;
+extern void rrdhost_init(char *hostname);
 
 #ifdef NETDATA_INTERNAL_CHECKS
 #define rrdhost_check_wrlock(host) rrdhost_check_wrlock_int(host, __FILE__, __FUNCTION__, __LINE__)
@@ -358,11 +356,11 @@ extern RRDSET *rrdset_find(const char *id);
 extern RRDSET *rrdset_find_bytype(const char *type, const char *id);
 extern RRDSET *rrdset_find_byname(const char *name);
 
-extern void rrdset_next_usec(RRDSET *st, unsigned long long microseconds);
-extern void rrdset_next(RRDSET *st);
-extern void rrdset_next_plugins(RRDSET *st);
+extern void rrdset_next_usec_unfiltered(RRDSET *st, usec_t microseconds);
+extern void rrdset_next_usec(RRDSET *st, usec_t microseconds);
+#define rrdset_next(st) rrdset_next_usec(st, 0ULL)
 
-extern unsigned long long rrdset_done(RRDSET *st);
+extern usec_t rrdset_done(RRDSET *st);
 
 // get the total duration in seconds of the round robin database
 #define rrdset_duration(st) ((time_t)( (((st)->counter >= ((unsigned long)(st)->entries))?(unsigned long)(st)->entries:(st)->counter) * (st)->update_every ))