From aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Feb 2023 17:11:30 +0100 Subject: Adding upstream version 1.38.0. Signed-off-by: Daniel Baumann --- database/rrdcontext.h | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'database/rrdcontext.h') diff --git a/database/rrdcontext.h b/database/rrdcontext.h index 67e6cf394..eae37036c 100644 --- a/database/rrdcontext.h +++ b/database/rrdcontext.h @@ -118,15 +118,37 @@ 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; @@ -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 { -- cgit v1.2.3