mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
b39e9257eb
Prometheus spec says that only \, \n and " must be escaped inside label values.
See 995743836e/content/docs/instrumenting/exposition_formats.md (L90)
See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5431
38 lines
737 B
Go
38 lines
737 B
Go
package prometheus
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmselect/netstorage"
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
)
|
|
|
|
func BenchmarkFederate(b *testing.B) {
|
|
rs := &netstorage.Result{
|
|
MetricName: storage.MetricName{
|
|
MetricGroup: []byte("foo_bar_bazaaaa_total"),
|
|
Tags: []storage.Tag{
|
|
{
|
|
Key: []byte("instance"),
|
|
Value: []byte("foobarbaz:2344"),
|
|
},
|
|
{
|
|
Key: []byte("job"),
|
|
Value: []byte("aaabbbccc"),
|
|
},
|
|
},
|
|
},
|
|
Values: []float64{112.23},
|
|
Timestamps: []int64{1234567890},
|
|
}
|
|
|
|
b.ReportAllocs()
|
|
b.RunParallel(func(pb *testing.PB) {
|
|
var bb bytes.Buffer
|
|
for pb.Next() {
|
|
bb.Reset()
|
|
WriteFederate(&bb, rs)
|
|
}
|
|
})
|
|
}
|