mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
5a4e4f6936
promql: Fix stddev/stdvar when aggregating histograms, NaNs, and Infs Native histograms are ignored when calculating stddev or stdvar. However, for the first series of each group, a `groupedAggregation` is always created. If the first series that was encountered is a histogram then it acts as the equivalent of a 0 point. This change creates the first `groupedAggregation` with the `seen` field set to `false` if the point is a histogram, thus ignoring it like the rest of the aggregation function does. A new `groupedAggregation` will then be created once an actual float value is encountered. This commit also sets the `floatValue` field of the `groupedAggregation` to `NaN`, if the first float value of a group is `NaN` or `±Inf`, so that the outcome is consistently `NaN` once those values are in the mix. (The added tests fail without this change). Signed-off-by: Joshua Hesketh <josh@nitrotech.org> Signed-off-by: beorn7 <beorn@grafana.com> --------- Signed-off-by: Joshua Hesketh <josh@nitrotech.org> Signed-off-by: beorn7 <beorn@grafana.com> Co-authored-by: beorn7 <beorn@grafana.com> |
||
---|---|---|
.. | ||
fuzz-data | ||
parser | ||
promqltest | ||
bench_test.go | ||
engine.go | ||
engine_internal_test.go | ||
engine_test.go | ||
functions.go | ||
functions_internal_test.go | ||
functions_test.go | ||
fuzz.go | ||
fuzz_test.go | ||
histogram_stats_iterator.go | ||
histogram_stats_iterator_test.go | ||
promql_test.go | ||
quantile.go | ||
quantile_test.go | ||
query_logger.go | ||
query_logger_test.go | ||
value.go | ||
value_test.go |