File: histogram_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 (17 lines) | stat: -rw-r--r-- 265 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package metrics

import (
	"testing"
)

func BenchmarkHistogramUpdate(b *testing.B) {
	h := GetOrCreateHistogram("BenchmarkHistogramUpdate")
	b.ReportAllocs()
	b.RunParallel(func(pb *testing.PB) {
		i := 0
		for pb.Next() {
			h.Update(float64(i))
			i++
		}
	})
}