File: push_timing_test.go

package info (click to toggle)
golang-github-victoriametrics-metrics 1.35.2%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 308 kB
  • sloc: makefile: 2
file content (20 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
		}
	})
}