mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 05:41:01 +02:00
[TESTS] PromQL: Add benchmark for PreprocessExpr
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
f1c6fab7e1
commit
0339fbd5a3
@ -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…
x
Reference in New Issue
Block a user