From a48acbcb238d42ab28b7811f922ce9676f065660 Mon Sep 17 00:00:00 2001 From: Tobias Guggenmos Date: Fri, 20 Dec 2019 12:30:41 +0100 Subject: [PATCH] PromQL: Fix parser benchmark (#6495) The parser benchmarks called the `ParseMetric` function instead of the `ParseExpr` function, which resulted in parsing failing every time. This means only the case of PromQL parser failure was benchmarked. Signed-off-by: Tobias Guggenmos --- promql/bench_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promql/bench_test.go b/promql/bench_test.go index 966164bb28..fe2708fb25 100644 --- a/promql/bench_test.go +++ b/promql/bench_test.go @@ -250,7 +250,7 @@ func BenchmarkParser(b *testing.B) { b.Run(c, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - ParseMetric(c) + ParseExpr(c) } }) } @@ -259,7 +259,7 @@ func BenchmarkParser(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - ParseMetric(c) + ParseExpr(c) } }) }