mirror of
https://github.com/prometheus/prometheus
synced 2026-05-01 07:30:30 +08:00
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 <tguggenm@redhat.com>
This commit is contained in:
committed by
Brian Brazil
parent
1e0cd28bf6
commit
a48acbcb23
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user