mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-01 15:33:35 +00: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
978c1e930e
commit
43871e79c6
1 changed files with 4 additions and 2 deletions
|
@ -363,9 +363,11 @@ func transformBucketsLimit(tfa *transformFuncArg) ([]*timeseries, error) {
|
||||||
xxMinIdx = i
|
xxMinIdx = i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if xxMinIdx+1 < len(leGroup) {
|
if xxMinIdx+1 == len(leGroup) {
|
||||||
leGroup[xxMinIdx+1].hits += leGroup[xxMinIdx].hits
|
// 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:]...)
|
leGroup = append(leGroup[:xxMinIdx], leGroup[xxMinIdx+1:]...)
|
||||||
}
|
}
|
||||||
for _, xx := range leGroup {
|
for _, xx := range leGroup {
|
||||||
|
|
Loading…
Reference in a new issue