mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
app/vmselect/promql: avoid dropping inf
bucket in buckets_limit
The `le="inf"` bucket must be preserved in order to maintain the maximum level of accuracy.
This commit is contained in:
parent
97b6f5d223
commit
edb1eca6f1
@ -363,9 +363,11 @@ func transformBucketsLimit(tfa *transformFuncArg) ([]*timeseries, error) {
|
||||
xxMinIdx = i
|
||||
}
|
||||
}
|
||||
if xxMinIdx+1 < len(leGroup) {
|
||||
leGroup[xxMinIdx+1].hits += leGroup[xxMinIdx].hits
|
||||
if xxMinIdx+1 == len(leGroup) {
|
||||
// Merge the `inf` bucket with the previous bucket in order to save accuracy.
|
||||
xxMinIdx--
|
||||
}
|
||||
leGroup[xxMinIdx+1].hits += leGroup[xxMinIdx].hits
|
||||
leGroup = append(leGroup[:xxMinIdx], leGroup[xxMinIdx+1:]...)
|
||||
}
|
||||
for _, xx := range leGroup {
|
||||
|
Loading…
Reference in New Issue
Block a user