mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +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) {
|
||||
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 {
|
||||
return -inf
|
||||
}
|
||||
@ -331,16 +339,8 @@ func transformHistogramQuantile(tfa *transformFuncArg) ([]*timeseries, error) {
|
||||
return inf
|
||||
}
|
||||
vReq := xss[len(xss)-1].ts.Values[i] * phi
|
||||
if math.IsNaN(vReq) || vReq < 0 {
|
||||
// Broken bucket.
|
||||
return nan
|
||||
}
|
||||
for _, xs := range xss {
|
||||
v := xs.ts.Values[i]
|
||||
if math.IsNaN(v) || v < 0 {
|
||||
// Broken bucket.
|
||||
return nan
|
||||
}
|
||||
le := xs.le
|
||||
if v < vReq {
|
||||
vPrev = v
|
||||
|
Loading…
Reference in New Issue
Block a user