snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s
Some checks failed
master / ci (push) Failing after 0s
This commit is contained in:
34
pubsub/gochannel/pubsub_bench_test.go
Normal file
34
pubsub/gochannel/pubsub_bench_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package gochannel_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/ThreeDotsLabs/watermill/pubsub/gochannel"
|
||||
|
||||
"github.com/ThreeDotsLabs/watermill/pubsub/tests"
|
||||
|
||||
"github.com/ThreeDotsLabs/watermill"
|
||||
"github.com/ThreeDotsLabs/watermill/message"
|
||||
)
|
||||
|
||||
func BenchmarkSubscriber(b *testing.B) {
|
||||
tests.BenchSubscriber(b, func(n int) (message.Publisher, message.Subscriber) {
|
||||
pubSub := gochannel.NewGoChannel(
|
||||
gochannel.Config{OutputChannelBuffer: int64(n)}, watermill.NopLogger{},
|
||||
)
|
||||
return pubSub, pubSub
|
||||
})
|
||||
}
|
||||
|
||||
func BenchmarkSubscriberPersistent(b *testing.B) {
|
||||
tests.BenchSubscriber(b, func(n int) (message.Publisher, message.Subscriber) {
|
||||
pubSub := gochannel.NewGoChannel(
|
||||
gochannel.Config{
|
||||
OutputChannelBuffer: int64(n),
|
||||
Persistent: true,
|
||||
},
|
||||
watermill.NopLogger{},
|
||||
)
|
||||
return pubSub, pubSub
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user