added channel parallel benchmark

This commit is contained in:
Bruce Marriner 2016-05-25 15:42:14 -05:00
parent 4677b9c7e1
commit 88e3540ee4

View File

@ -20,6 +20,21 @@ func BenchmarkGenerateChan(b *testing.B) {
} }
// Benchmarks Presence Update event with fake data.
func BenchmarkGenerateChanParallel(b *testing.B) {
node, _ := NewFlakeNode(1)
c := make(chan Flake)
go node.Generator(c)
b.ReportAllocs()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
<-c
}
})
}
// Benchmarks Presence Update event with fake data. // Benchmarks Presence Update event with fake data.
func BenchmarkGenerate(b *testing.B) { func BenchmarkGenerate(b *testing.B) {