app/vmselect: make fmt after f3ece83e67

This commit is contained in:
Aliaksandr Valialkin 2022-07-05 14:35:24 +03:00
parent 8516670582
commit 10c63f5853
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 8 additions and 8 deletions

View file

@ -1002,7 +1002,7 @@ func fixBrokenBuckets(i int, xss []leTimeseries) {
if len(xss) < 2 {
return
}
for j := len(xss)-1; j>=0; j-- {
for j := len(xss) - 1; j >= 0; j-- {
v := xss[j].ts.Values[i]
if !math.IsNaN(v) {
j++
@ -1014,7 +1014,7 @@ func fixBrokenBuckets(i int, xss []leTimeseries) {
}
}
vNext := xss[len(xss)-1].ts.Values[i]
for j := len(xss)-2; j >= 0; j-- {
for j := len(xss) - 2; j >= 0; j-- {
v := xss[j].ts.Values[i]
if math.IsNaN(v) || v > vNext {
xss[j].ts.Values[i] = vNext

View file

@ -25,10 +25,10 @@ func TestFixBrokenBuckets(t *testing.T) {
}
f(nil, []float64{})
f([]float64{1}, []float64{1})
f([]float64{1,2}, []float64{1,2})
f([]float64{2,1}, []float64{1,1})
f([]float64{1,2,3,nan,nan},[]float64{1,2,3,3,3})
f([]float64{5,1,2,3,nan}, []float64{1,1,2,3,3})
f([]float64{1,5,2,nan,6,3}, []float64{1,2,2,3,3,3})
f([]float64{5,10,4,3}, []float64{3,3,3,3})
f([]float64{1, 2}, []float64{1, 2})
f([]float64{2, 1}, []float64{1, 1})
f([]float64{1, 2, 3, nan, nan}, []float64{1, 2, 3, 3, 3})
f([]float64{5, 1, 2, 3, nan}, []float64{1, 1, 2, 3, 3})
f([]float64{1, 5, 2, nan, 6, 3}, []float64{1, 2, 2, 3, 3, 3})
f([]float64{5, 10, 4, 3}, []float64{3, 3, 3, 3})
}