metrics/push_timing_test.go
2022-07-21 18:42:53 +03:00

21 lines
320 B
Go

package metrics
import (
"testing"
)
func BenchmarkAddExtraLabels(b *testing.B) {
extraLabels := `foo="bar"`
src := []byte(`foo 1
bar{baz="x"} 2
`)
b.ReportAllocs()
b.SetBytes(1)
b.RunParallel(func(pb *testing.PB) {
var dst []byte
for pb.Next() {
dst = addExtraLabels(dst[:0], src, extraLabels)
}
})
}