(b *testing.B)
| 86 | } |
| 87 | |
| 88 | func 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 | |
| 110 | type harness struct { |
| 111 | conn amqpConnection |
nothing calls this directly
no test coverage detected