mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
31 lines
522 B
Go
31 lines
522 B
Go
package promscrape
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
|
|
)
|
|
|
|
func BenchmarkInternLabelStrings(b *testing.B) {
|
|
b.ReportAllocs()
|
|
b.SetBytes(1)
|
|
b.RunParallel(func(pb *testing.PB) {
|
|
labels := []prompbmarshal.Label{
|
|
{
|
|
Name: "job",
|
|
Value: "node-exporter",
|
|
},
|
|
{
|
|
Name: "instance",
|
|
Value: "foo.bar.baz:1234",
|
|
},
|
|
{
|
|
Name: "__meta_kubernetes_namespace",
|
|
Value: "default",
|
|
},
|
|
}
|
|
for pb.Next() {
|
|
internLabelStrings(labels)
|
|
}
|
|
})
|
|
}
|