BenchmarkPoolHighContention tests pool performance under high contention
(b *testing.B)
| 361 | |
| 362 | // BenchmarkPoolHighContention tests pool performance under high contention |
| 363 | func BenchmarkPoolHighContention(b *testing.B) { |
| 364 | ctx := context.Background() |
| 365 | client := benchmarkClient(32) |
| 366 | defer client.Close() |
| 367 | |
| 368 | b.ResetTimer() |
| 369 | b.ReportAllocs() |
| 370 | |
| 371 | b.RunParallel(func(pb *testing.PB) { |
| 372 | for pb.Next() { |
| 373 | // High contention Get/Put operations |
| 374 | pubsub := client.Subscribe(ctx, "test-channel") |
| 375 | pubsub.Close() |
| 376 | } |
| 377 | }) |
| 378 | } |
nothing calls this directly
no test coverage detected