Skip to content

Commit ce570bd

Browse files
committed
Intermediate changes
commit_hash:975fc6e29c260d8ba42f32422ed51c2109930be9
1 parent 351a79e commit ce570bd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

observability/lib/querylang/parser/v2/parser_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,19 @@ func TestParseExpression(t *testing.T) {
313313
})
314314
}
315315
}
316+
317+
func BenchmarkParser(b *testing.B) {
318+
b.Run("Selector", func(b *testing.B) {
319+
for i := 0; i < b.N; i++ {
320+
p := parserv2.NewParser()
321+
_, _ = p.ParseSelector(`{project="a*", service=="b*", cluster!="c*", other!=="d|c"}`)
322+
}
323+
})
324+
325+
b.Run("Expression", func(b *testing.B) {
326+
for i := 0; i < b.N; i++ {
327+
p := parserv2.NewParser()
328+
_, _ = p.ParseExpression(`filter({a = 1}, any( all(eq('a', 'b'), eq('c', 'd')), eq('x', 'y') ))`)
329+
}
330+
})
331+
}

0 commit comments

Comments
 (0)