MCPcopy
hub / github.com/rs/zerolog / BenchmarkSamplers

Function BenchmarkSamplers

sampler_test.go:94–106  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

92}
93
94func BenchmarkSamplers(b *testing.B) {
95 for i := range samplers {
96 s := samplers[i]
97 b.Run(s.name, func(b *testing.B) {
98 sampler := s.sampler()
99 b.RunParallel(func(pb *testing.PB) {
100 for pb.Next() {
101 sampler.Sample(0)
102 }
103 })
104 })
105 }
106}
107
108func TestBurst(t *testing.T) {
109 sampler := &BurstSampler{Burst: 1, Period: time.Second}

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
NextMethod · 0.65
SampleMethod · 0.65

Tested by

no test coverage detected