mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-14 16:12:15 +01: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
b96d55e1e4
commit
c5e3b11762
@ -1171,7 +1171,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)
|
||||
|
@ -583,7 +583,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 New Issue
Block a user