diff --git a/crates/e2e/tests/aggregate.rs b/crates/e2e/tests/aggregate.rs index a56c1813..b5a752ba 100644 --- a/crates/e2e/tests/aggregate.rs +++ b/crates/e2e/tests/aggregate.rs @@ -139,7 +139,7 @@ fn q_stddev_no_group() { vec![], AggIntent::StdDev { col: None, - population: false + population: true }, scan("http_requests_total", &[]) ), @@ -155,7 +155,7 @@ fn q_stdvar_no_group() { vec![], AggIntent::Variance { col: None, - population: false + population: true }, scan("http_requests_total", &[]) ), diff --git a/crates/e2e/tests/time_range.rs b/crates/e2e/tests/time_range.rs index d04f7fd9..ac5bcc3a 100644 --- a/crates/e2e/tests/time_range.rs +++ b/crates/e2e/tests/time_range.rs @@ -119,7 +119,7 @@ fn q_stddev_over_time() { 300, AggIntent::StdDev { col: None, - population: false + population: true }, "http_requests_total" ), @@ -135,7 +135,7 @@ fn q_stdvar_over_time() { 300, AggIntent::Variance { col: None, - population: false + population: true }, "http_requests_total" ), diff --git a/crates/lower/src/promql.rs b/crates/lower/src/promql.rs index c3b96981..c96b407d 100644 --- a/crates/lower/src/promql.rs +++ b/crates/lower/src/promql.rs @@ -510,8 +510,8 @@ fn inner_func(f: &InnerFunc) -> AggFunc { InnerFunc::Min => AggFunc::Min, InnerFunc::Max => AggFunc::Max, InnerFunc::Sum => AggFunc::Sum, - InnerFunc::StdDev => AggFunc::StdDev { population: false }, - InnerFunc::Variance => AggFunc::Variance { population: false }, + InnerFunc::StdDev => AggFunc::StdDev { population: true }, + InnerFunc::Variance => AggFunc::Variance { population: true }, InnerFunc::Count => AggFunc::Count, InnerFunc::Rate(w) => AggFunc::Rate { window: *w }, InnerFunc::Increase(w) => AggFunc::Increase { window: *w }, @@ -524,8 +524,8 @@ fn outer_func(o: &OuterIntent) -> AggFunc { OuterIntent::Avg => AggFunc::Avg, OuterIntent::Min => AggFunc::Min, OuterIntent::Max => AggFunc::Max, - OuterIntent::StdDev => AggFunc::StdDev { population: false }, - OuterIntent::Variance => AggFunc::Variance { population: false }, + OuterIntent::StdDev => AggFunc::StdDev { population: true }, + OuterIntent::Variance => AggFunc::Variance { population: true }, OuterIntent::Quantile(q) => AggFunc::Quantile(*q), } } diff --git a/crates/lower/tests/promql_lowering.rs b/crates/lower/tests/promql_lowering.rs index fe176112..e67365df 100644 --- a/crates/lower/tests/promql_lowering.rs +++ b/crates/lower/tests/promql_lowering.rs @@ -122,7 +122,7 @@ fn stddev_and_stdvar_over_time() { assert!(matches!( aggs.as_slice(), [AggIntent::StdDev { - population: false, + population: true, .. }] )); @@ -135,7 +135,7 @@ fn stddev_and_stdvar_over_time() { assert!(matches!( aggs.as_slice(), [AggIntent::Variance { - population: false, + population: true, .. }] ));