(i int, b *testing.B)
| 11 | func Benchmark20Workers(b *testing.B) { benchmarkWorkers(20, b) } |
| 12 | |
| 13 | func benchmarkWorkers(i int, b *testing.B) { |
| 14 | for n := 0; n < b.N; n++ { |
| 15 | workerPool := &workerPool{ |
| 16 | wg: new(sync.WaitGroup), |
| 17 | msgs: make(chan string), |
| 18 | numWorkers: i, |
| 19 | mu: new(sync.Mutex), |
| 20 | } |
| 21 | go workerPool.queueMessages() |
| 22 | _ = workerPool.run() |
| 23 | } |
| 24 | } |
no test coverage detected