(b *testing.B)
| 92 | } |
| 93 | |
| 94 | func 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 | |
| 108 | func TestBurst(t *testing.T) { |
| 109 | sampler := &BurstSampler{Burst: 1, Period: time.Second} |