mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +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
|
||||
}
|
||||
}
|
||||
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 a new issue