Skip to content

Commit f065be1

Browse files
committed
benchmark name sanitization
1 parent e8695a1 commit f065be1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

metric_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,18 @@ func TestNameSanitizedAsTagValue(t *testing.T) {
175175
}
176176
}
177177
}
178+
179+
func BenchmarkNameSanitizedAsTagValueWithValidValue(b *testing.B) {
180+
inputValue := "some.id.of.a.metric.1"
181+
182+
for i := 0; i < b.N; i++ {
183+
SanitizeNameAsTagValue(inputValue)
184+
}
185+
}
186+
func BenchmarkNameSanitizedAsTagValueWithInvalidValue(b *testing.B) {
187+
inputValue := "~some.id.of.a.metric.1"
188+
189+
for i := 0; i < b.N; i++ {
190+
SanitizeNameAsTagValue(inputValue)
191+
}
192+
}

0 commit comments

Comments
 (0)