mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 23:19:41 -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> |
||
---|---|---|
.. | ||
aggregators.test | ||
at_modifier.test | ||
collision.test | ||
functions.test | ||
histograms.test | ||
limit.test | ||
literals.test | ||
name_label_dropping.test | ||
native_histograms.test | ||
operators.test | ||
range_queries.test | ||
selectors.test | ||
staleness.test | ||
subquery.test | ||
trig_functions.test |