MCPcopy Create free account
hub / github.com/google/go-cloud / BenchmarkRabbit

Function BenchmarkRabbit

pubsub/rabbitpubsub/rabbit_test.go:88–108  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

86}
87
88func BenchmarkRabbit(b *testing.B) {
89 ctx := context.Background()
90 h := &harness{conn: mustDialRabbit(b)}
91 dt, cleanup, err := h.CreateTopic(ctx, b.Name())
92 if err != nil {
93 b.Fatal(err)
94 }
95 defer cleanup()
96 ds, cleanup, err := h.CreateSubscription(ctx, dt, b.Name())
97 if err != nil {
98 b.Fatal(err)
99 }
100 defer cleanup()
101
102 topic := pubsub.NewTopic(dt, nil)
103 defer topic.Shutdown(ctx)
104 sub := pubsub.NewSubscription(ds, nil, nil)
105 defer sub.Shutdown(ctx)
106
107 drivertest.RunBenchmarks(b, topic, sub)
108}
109
110type harness struct {
111 conn amqpConnection

Callers

nothing calls this directly

Calls 7

CreateTopicMethod · 0.95
CreateSubscriptionMethod · 0.95
ShutdownMethod · 0.95
ShutdownMethod · 0.95
RunBenchmarksFunction · 0.92
mustDialRabbitFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected