mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: remove duplicated logic of filling NaN values for histograms
Removed logic was used to fill nan values with lower buckets values: [1 2 3 nan nan nan] => [1 2 3 3 3 3]. Since buckets are now fixed from lower ones to upper this happens in the main loop, so there is no need in a second one. Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
This commit is contained in:
parent
d861062769
commit
7ccd047e53
1 changed files with 1 additions and 12 deletions
|
@ -1049,18 +1049,7 @@ func fixBrokenBuckets(i int, xss []leTimeseries) {
|
||||||
if len(xss) < 2 {
|
if len(xss) < 2 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Fill NaN in upper buckets with the first non-NaN value found in lower buckets.
|
|
||||||
for j := len(xss) - 1; j >= 0; j-- {
|
|
||||||
v := xss[j].ts.Values[i]
|
|
||||||
if !math.IsNaN(v) {
|
|
||||||
j++
|
|
||||||
for j < len(xss) {
|
|
||||||
xss[j].ts.Values[i] = v
|
|
||||||
j++
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Substitute upper bucket values with lower bucket values if the upper values are NaN
|
// Substitute upper bucket values with lower bucket values if the upper values are NaN
|
||||||
// or are bigger than the lower bucket values.
|
// or are bigger than the lower bucket values.
|
||||||
vNext := xss[0].ts.Values[0]
|
vNext := xss[0].ts.Values[0]
|
||||||
|
|
Loading…
Reference in a new issue