diff --git a/rules/ast/ast.go b/rules/ast/ast.go index eff53ede5..e2bc5ec9b 100644 --- a/rules/ast/ast.go +++ b/rules/ast/ast.go @@ -392,7 +392,7 @@ func EvalVectorInstant(node VectorNode, timestamp clientmodel.Timestamp, storage totalEvalTimer := queryStats.GetTimer(stats.TotalEvalTime).Start() defer totalEvalTimer.Stop() - closer, err := prepareInstantQuery(node, timestamp, storage, queryStats) + closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats) if err != nil { return nil, err } @@ -412,7 +412,7 @@ func EvalVectorRange(node VectorNode, start clientmodel.Timestamp, end clientmod matrix := Matrix{} prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start() - closer, err := prepareRangeQuery(node, start, end, interval, storage, queryStats) + closer, err := PrepareRangeQuery(node, start, end, interval, storage, queryStats) prepareTimer.Stop() if err != nil { return nil, err diff --git a/rules/ast/printer.go b/rules/ast/printer.go index 182f8544a..93163bf8f 100644 --- a/rules/ast/printer.go +++ b/rules/ast/printer.go @@ -166,7 +166,7 @@ func EvalToString(node Node, timestamp clientmodel.Timestamp, format OutputForma defer totalEvalTimer.Stop() prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start() - closer, err := prepareInstantQuery(node, timestamp, storage, queryStats) + closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats) prepareTimer.Stop() if err != nil { panic(err) @@ -221,7 +221,7 @@ func EvalToVector(node Node, timestamp clientmodel.Timestamp, storage local.Stor defer totalEvalTimer.Stop() prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start() - closer, err := prepareInstantQuery(node, timestamp, storage, queryStats) + closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats) prepareTimer.Stop() if err != nil { panic(err) diff --git a/rules/ast/query_analyzer.go b/rules/ast/query_analyzer.go index 9807f7527..fe7f2569c 100644 --- a/rules/ast/query_analyzer.go +++ b/rules/ast/query_analyzer.go @@ -120,7 +120,8 @@ func (i *iteratorInitializer) visit(node Node) { } } -func prepareInstantQuery(node Node, timestamp clientmodel.Timestamp, storage local.Storage, queryStats *stats.TimerGroup) (local.Preloader, error) { +// PrepareInstantQuery analyzes the query and preloads the necessary time range for each series. +func PrepareInstantQuery(node Node, timestamp clientmodel.Timestamp, storage local.Storage, queryStats *stats.TimerGroup) (local.Preloader, error) { totalTimer := queryStats.GetTimer(stats.TotalEvalTime) analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start() @@ -167,7 +168,8 @@ func prepareInstantQuery(node Node, timestamp clientmodel.Timestamp, storage loc return p, nil } -func prepareRangeQuery(node Node, start clientmodel.Timestamp, end clientmodel.Timestamp, interval time.Duration, storage local.Storage, queryStats *stats.TimerGroup) (local.Preloader, error) { +// PrepareRangeQuery analyzes the query and preloads the necessary time range for each series. +func PrepareRangeQuery(node Node, start clientmodel.Timestamp, end clientmodel.Timestamp, interval time.Duration, storage local.Storage, queryStats *stats.TimerGroup) (local.Preloader, error) { totalTimer := queryStats.GetTimer(stats.TotalEvalTime) analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start()