mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: apply SLO-like optimization to all the count_*_over_time()
functions
This is a follow-up for 41a0fdaf39
This commit is contained in:
parent
0189081490
commit
92826b0b4a
2 changed files with 11 additions and 2 deletions
|
@ -1149,7 +1149,15 @@ func evalInstantRollup(qt *querytracer.Tracer, ec *EvalConfig, funcName string,
|
|||
},
|
||||
}
|
||||
return evalExpr(qt, ec, be)
|
||||
case "count_over_time", "sum_over_time", "increase":
|
||||
case
|
||||
"count_eq_over_time",
|
||||
"count_gt_over_time",
|
||||
"count_le_over_time",
|
||||
"count_ne_over_time",
|
||||
"count_over_time",
|
||||
"increase",
|
||||
"increase_pure",
|
||||
"sum_over_time":
|
||||
if iafc != nil && strings.ToLower(iafc.ae.Name) != "sum" {
|
||||
qt.Printf("do not apply instant rollup optimization for non-sum incremental aggregate %s()", iafc.ae.Name)
|
||||
return evalAt(qt, timestamp, window)
|
||||
|
|
|
@ -625,7 +625,8 @@ func mergeTimeseries(qt *querytracer.Tracer, a, b []*timeseries, bStart int64, e
|
|||
}
|
||||
tmp.Values = append(tmp.Values, tsB.Values...)
|
||||
if len(tmp.Values) != len(tmp.Timestamps) {
|
||||
logger.Panicf("BUG: unexpected values after merging new values; got %d; want %d", len(tmp.Values), len(tmp.Timestamps))
|
||||
logger.Panicf("BUG: unexpected values after merging new values; got %d; want %d; len(a.Values)=%d; len(b.Values)=%d",
|
||||
len(tmp.Values), len(tmp.Timestamps), len(tsA.Values), len(tsB.Values))
|
||||
}
|
||||
rvs = append(rvs, &tmp)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue