prometheus/promql/promqltest/testdata
Joshua Hesketh 5a4e4f6936
Fix stddev/stdvar when aggregating histograms, NaNs, and infinities (#14941)
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>
2024-10-16 15:00:46 +02:00
..
aggregators.test Fix stddev/stdvar when aggregating histograms, NaNs, and infinities (#14941) 2024-10-16 15:00:46 +02:00
at_modifier.test Merge branch 'main' into 3.0-main-sync-24-07-18 2024-07-18 15:56:40 +02:00
collision.test test: move test files into new promqltest package 2024-05-08 13:42:55 +01:00
functions.test promql: rename holt_winters to double_exponential_smoothing 2024-09-19 15:29:01 +02:00
histograms.test Add additional basic nhcb unit tests (#15086) 2024-10-08 14:34:32 +02:00
limit.test feat: add limitk() and limit_ratio() operators (#12503) 2024-07-03 22:18:57 +02:00
literals.test test: move test files into new promqltest package 2024-05-08 13:42:55 +01:00
name_label_dropping.test promqltest: adjust eval times and range selector 2024-09-02 11:27:39 +02:00
native_histograms.test Corrects the behaviour of binary opperators between histogram and float (#14726) 2024-10-15 14:44:36 +02:00
operators.test make matrix selection and lookback left-open and right-closed 2024-06-20 22:05:40 +08:00
range_queries.test make matrix selection and lookback left-open and right-closed 2024-06-20 22:05:40 +08:00
selectors.test test: move test files into new promqltest package 2024-05-08 13:42:55 +01:00
staleness.test Merge branch 'main' into 3.0-main-sync-24-07-18 2024-07-18 15:56:40 +02:00
subquery.test Merge branch 'main' into 3.0-main-sync-24-07-18 2024-07-18 15:56:40 +02:00
trig_functions.test make matrix selection and lookback left-open and right-closed 2024-06-20 22:05:40 +08:00