Fixed benchmark tests

This commit is contained in:
James Mills 2018-03-03 19:42:50 +00:00
parent 8c7d3ee00a
commit 31e672a2d0
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -47,7 +47,7 @@ func BenchmarkMessageBusPut(b *testing.B) {
func BenchmarkMessageBusGet(b *testing.B) {
mb := NewMessageBus(nil)
topic := mb.NewTopic("foo")
msg := Message{Payload: []byte("foo")}
msg := Message{Topic: topic, Payload: []byte("foo")}
for i := 0; i < b.N; i++ {
mb.Put(msg)
}
@ -69,7 +69,7 @@ func BenchmarkMessageBusGetEmpty(b *testing.B) {
func BenchmarkMessageBusPutGet(b *testing.B) {
mb := NewMessageBus(nil)
topic := mb.NewTopic("foo")
msg := Message{Payload: []byte("foo")}
msg := Message{Topic: topic, Payload: []byte("foo")}
b.ResetTimer()
for i := 0; i < b.N; i++ {
mb.Put(msg)