Skip to content

Commit

Permalink
test(otelstorage): add KeyToLabel benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jul 19, 2024
1 parent c311fe4 commit 00f4c17
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/otelstorage/attrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,15 @@ func TestKeyToLabelAllocs(t *testing.T) {
}
}
}

func BenchmarkKeyToLabel(b *testing.B) {
b.ReportAllocs()

var sink string
for i := 0; i < b.N; i++ {
sink = KeyToLabel("receiver/accepted_spans/0")
}
if sink == "" {
b.Fatal()
}
}

0 comments on commit 00f4c17

Please sign in to comment.