From 80ac0d7c82cc325932c1934ad9f7e55e8ed3e479 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 23 Dec 2022 20:24:20 +0000 Subject: [PATCH] promql: add benchmark for match against blank string Blank strings are not handled efficiently by tsdb. Signed-off-by: Bryan Boreham --- promql/bench_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/promql/bench_test.go b/promql/bench_test.go index 6fb20d1aba..8abfcfdd20 100644 --- a/promql/bench_test.go +++ b/promql/bench_test.go @@ -174,6 +174,15 @@ func rangeQueryCases() []benchCase { { expr: "a_X + on(l) group_right a_one", }, + // Label compared to blank string. + { + expr: "count({__name__!=\"\"})", + steps: 1, + }, + { + expr: "count({__name__!=\"\",l=\"\"})", + steps: 1, + }, } // X in an expr will be replaced by different metric sizes.