summaryrefslogtreecommitdiffstats
path: root/database/rrdcontext.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
commitd079b656b4719739b2247dcd9d46e9bec793095a (patch)
treed2c950c70a776bcf697c963151c5bd959f8a9f03 /database/rrdcontext.h
parentReleasing debian version 1.37.1-2. (diff)
downloadnetdata-d079b656b4719739b2247dcd9d46e9bec793095a.tar.xz
netdata-d079b656b4719739b2247dcd9d46e9bec793095a.zip
Merging upstream version 1.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/rrdcontext.h')
-rw-r--r--database/rrdcontext.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/database/rrdcontext.h b/database/rrdcontext.h
index 67e6cf394..eae37036c 100644
--- a/database/rrdcontext.h
+++ b/database/rrdcontext.h
@@ -118,16 +118,38 @@ DICTIONARY *rrdcontext_all_metrics_to_dict(RRDHOST *host, SIMPLE_PATTERN *contex
// ----------------------------------------------------------------------------
// public API for queries
+typedef struct query_plan_entry {
+ size_t tier;
+ time_t after;
+ time_t before;
+ time_t expanded_after;
+ time_t expanded_before;
+ struct storage_engine_query_handle handle;
+ STORAGE_POINT (*next_metric)(struct storage_engine_query_handle *handle);
+ int (*is_finished)(struct storage_engine_query_handle *handle);
+ void (*finalize)(struct storage_engine_query_handle *handle);
+ bool initialized;
+ bool finalized;
+} QUERY_PLAN_ENTRY;
+
+#define QUERY_PLANS_MAX (RRD_STORAGE_TIERS * 2)
+
typedef struct query_metric {
struct query_metric_tier {
struct storage_engine *eng;
STORAGE_METRIC_HANDLE *db_metric_handle;
- time_t db_first_time_t; // the oldest timestamp available for this tier
- time_t db_last_time_t; // the latest timestamp available for this tier
- time_t db_update_every; // latest update every for this tier
+ time_t db_first_time_s; // the oldest timestamp available for this tier
+ time_t db_last_time_s; // the latest timestamp available for this tier
+ time_t db_update_every_s; // latest update every for this tier
+ long weight;
} tiers[RRD_STORAGE_TIERS];
struct {
+ size_t used;
+ QUERY_PLAN_ENTRY array[QUERY_PLANS_MAX];
+ } plan;
+
+ struct {
RRDHOST *host;
RRDCONTEXT_ACQUIRED *rca;
RRDINSTANCE_ACQUIRED *ria;
@@ -172,6 +194,7 @@ typedef struct query_target_request {
time_t resampling_time;
size_t tier;
QUERY_SOURCE query_source;
+ STORAGE_PRIORITY priority;
} QUERY_TARGET_REQUEST;
typedef struct query_target {
@@ -198,9 +221,9 @@ typedef struct query_target {
} window;
struct {
- time_t first_time_t; // the combined first_time_t of all metrics in the query, across all tiers
- time_t last_time_t; // the combined last_time_T of all metrics in the query, across all tiers
- time_t minimum_latest_update_every; // the min update every of the metrics in the query
+ time_t first_time_s; // the combined first_time_t of all metrics in the query, across all tiers
+ time_t last_time_s; // the combined last_time_T of all metrics in the query, across all tiers
+ time_t minimum_latest_update_every_s; // the min update every of the metrics in the query
} db;
struct {