mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-07 08:32:18 +01:00
app/vmselect/promql: return NaN from histogram_quantile if at least a single bucket is broken
This commit is contained in:
parent
b9a16b93e7
commit
071a122119
@ -324,6 +324,14 @@ func transformHistogramQuantile(tfa *transformFuncArg) ([]*timeseries, error) {
|
|||||||
if math.IsNaN(phi) {
|
if math.IsNaN(phi) {
|
||||||
return nan
|
return nan
|
||||||
}
|
}
|
||||||
|
// Verify for broken buckets with NaN or negative values.
|
||||||
|
for _, xs := range xss {
|
||||||
|
v := xs.ts.Values[i]
|
||||||
|
if math.IsNaN(v) || v < 0 {
|
||||||
|
// Broken bucket.
|
||||||
|
return nan
|
||||||
|
}
|
||||||
|
}
|
||||||
if phi < 0 {
|
if phi < 0 {
|
||||||
return -inf
|
return -inf
|
||||||
}
|
}
|
||||||
@ -331,16 +339,8 @@ func transformHistogramQuantile(tfa *transformFuncArg) ([]*timeseries, error) {
|
|||||||
return inf
|
return inf
|
||||||
}
|
}
|
||||||
vReq := xss[len(xss)-1].ts.Values[i] * phi
|
vReq := xss[len(xss)-1].ts.Values[i] * phi
|
||||||
if math.IsNaN(vReq) || vReq < 0 {
|
|
||||||
// Broken bucket.
|
|
||||||
return nan
|
|
||||||
}
|
|
||||||
for _, xs := range xss {
|
for _, xs := range xss {
|
||||||
v := xs.ts.Values[i]
|
v := xs.ts.Values[i]
|
||||||
if math.IsNaN(v) || v < 0 {
|
|
||||||
// Broken bucket.
|
|
||||||
return nan
|
|
||||||
}
|
|
||||||
le := xs.le
|
le := xs.le
|
||||||
if v < vReq {
|
if v < vReq {
|
||||||
vPrev = v
|
vPrev = v
|
||||||
|
Loading…
Reference in New Issue
Block a user