promtool: Add simple benchmark checkDuplicates benchmark
Add a simple benchmark with a large number of rules. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
This commit is contained in:
parent
794937b3d6
commit
3a309c1ae5
|
@ -151,3 +151,13 @@ func TestCheckDuplicates(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkCheckDuplicates(b *testing.B) {
|
||||
rgs, err := rulefmt.ParseFile("./testdata/rules_large.yml")
|
||||
require.Empty(b, err)
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
checkDuplicates(rgs.Groups)
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue