mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-29 06:30:51 -08:00
Merge pull request #648 from cesanta/cesanta
Make prepare{Instant,Range}Query public
This commit is contained in:
commit
16920f4666
|
@ -392,7 +392,7 @@ func EvalVectorInstant(node VectorNode, timestamp clientmodel.Timestamp, storage
|
||||||
totalEvalTimer := queryStats.GetTimer(stats.TotalEvalTime).Start()
|
totalEvalTimer := queryStats.GetTimer(stats.TotalEvalTime).Start()
|
||||||
defer totalEvalTimer.Stop()
|
defer totalEvalTimer.Stop()
|
||||||
|
|
||||||
closer, err := prepareInstantQuery(node, timestamp, storage, queryStats)
|
closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ func EvalVectorRange(node VectorNode, start clientmodel.Timestamp, end clientmod
|
||||||
matrix := Matrix{}
|
matrix := Matrix{}
|
||||||
|
|
||||||
prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start()
|
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()
|
prepareTimer.Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -166,7 +166,7 @@ func EvalToString(node Node, timestamp clientmodel.Timestamp, format OutputForma
|
||||||
defer totalEvalTimer.Stop()
|
defer totalEvalTimer.Stop()
|
||||||
|
|
||||||
prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start()
|
prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start()
|
||||||
closer, err := prepareInstantQuery(node, timestamp, storage, queryStats)
|
closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats)
|
||||||
prepareTimer.Stop()
|
prepareTimer.Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -221,7 +221,7 @@ func EvalToVector(node Node, timestamp clientmodel.Timestamp, storage local.Stor
|
||||||
defer totalEvalTimer.Stop()
|
defer totalEvalTimer.Stop()
|
||||||
|
|
||||||
prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start()
|
prepareTimer := queryStats.GetTimer(stats.TotalQueryPreparationTime).Start()
|
||||||
closer, err := prepareInstantQuery(node, timestamp, storage, queryStats)
|
closer, err := PrepareInstantQuery(node, timestamp, storage, queryStats)
|
||||||
prepareTimer.Stop()
|
prepareTimer.Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
@ -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)
|
totalTimer := queryStats.GetTimer(stats.TotalEvalTime)
|
||||||
|
|
||||||
analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start()
|
analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start()
|
||||||
|
@ -167,7 +168,8 @@ func prepareInstantQuery(node Node, timestamp clientmodel.Timestamp, storage loc
|
||||||
return p, nil
|
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)
|
totalTimer := queryStats.GetTimer(stats.TotalEvalTime)
|
||||||
|
|
||||||
analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start()
|
analyzeTimer := queryStats.GetTimer(stats.QueryAnalysisTime).Start()
|
||||||
|
|
Loading…
Reference in a new issue