({ requests, streams, clients, duration })
| 14 | }, { flags: ['--no-warnings'] }); |
| 15 | |
| 16 | function main({ requests, streams, clients, duration }) { |
| 17 | const http2 = require('http2'); |
| 18 | const server = http2.createServer(); |
| 19 | server.on('stream', (stream) => { |
| 20 | const out = fs.createReadStream(file); |
| 21 | stream.respond(); |
| 22 | out.pipe(stream); |
| 23 | stream.on('error', (err) => {}); |
| 24 | }); |
| 25 | server.listen(0, () => { |
| 26 | bench.http({ |
| 27 | path: '/', |
| 28 | port: server.address().port, |
| 29 | requests, |
| 30 | maxConcurrentStreams: streams, |
| 31 | clients, |
| 32 | duration, |
| 33 | threads: clients, |
| 34 | }, () => { server.close(); }); |
| 35 | }); |
| 36 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…