rest-server/vendor/github.com/beorn7/perks/histogram/bench_test.go
Konrad Wojas 4cd82b6802 Help needed: vendor files for Prometheus support
These are the vendor files needed for Prometheus support.
I have not been able to figure out how to do this properly with gopkg.
2017-10-25 17:53:37 +02:00

26 lines
378 B
Go

package histogram
import (
"math/rand"
"testing"
)
func BenchmarkInsert10Bins(b *testing.B) {
b.StopTimer()
h := New(10)
b.StartTimer()
for i := 0; i < b.N; i++ {
f := rand.ExpFloat64()
h.Insert(f)
}
}
func BenchmarkInsert100Bins(b *testing.B) {
b.StopTimer()
h := New(100)
b.StartTimer()
for i := 0; i < b.N; i++ {
f := rand.ExpFloat64()
h.Insert(f)
}
}