({ api, consumers, datasize, n })
| 18 | const CHUNK_SIZE = 64 * 1024; |
| 19 | |
| 20 | function main({ api, consumers, datasize, n }) { |
| 21 | const chunk = Buffer.alloc(CHUNK_SIZE, 'abcdefghij'); |
| 22 | const totalOps = (datasize * n) / (1024 * 1024); |
| 23 | |
| 24 | switch (api) { |
| 25 | case 'classic': |
| 26 | return benchClassic(chunk, consumers, datasize, n, totalOps); |
| 27 | case 'webstream': |
| 28 | return benchWebStream(chunk, consumers, datasize, n, totalOps); |
| 29 | case 'iter': |
| 30 | return benchIter(chunk, consumers, datasize, n, totalOps); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | function benchClassic(chunk, numConsumers, datasize, n, totalOps) { |
| 35 | function run(cb) { |
nothing calls this directly
no test coverage detected