mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
[TESTS] PromQL: Add benchmark for PreprocessExpr
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
f1c6fab7e1
commit
0339fbd5a3
1 changed files with 9 additions and 0 deletions
|
|
@ -660,6 +660,15 @@ func BenchmarkParser(b *testing.B) {
|
|||
}
|
||||
})
|
||||
}
|
||||
for _, c := range cases {
|
||||
b.Run("preprocess "+c, func(b *testing.B) {
|
||||
expr, _ := parser.ParseExpr(c)
|
||||
start, end := time.Now().Add(-time.Hour), time.Now()
|
||||
for i := 0; i < b.N; i++ {
|
||||
promql.PreprocessExpr(expr, start, end)
|
||||
}
|
||||
})
|
||||
}
|
||||
for _, c := range errCases {
|
||||
name := fmt.Sprintf("%s (should fail)", c)
|
||||
b.Run(name, func(b *testing.B) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue