({ type, len, c, duration })
| 18 | } |
| 19 | |
| 20 | function main({ type, len, c, duration }) { |
| 21 | process.env.PORT = PORT; |
| 22 | let workers = 0; |
| 23 | const w1 = cluster.fork(); |
| 24 | const w2 = cluster.fork(); |
| 25 | |
| 26 | cluster.on('listening', () => { |
| 27 | workers++; |
| 28 | if (workers < 2) |
| 29 | return; |
| 30 | |
| 31 | setImmediate(() => { |
| 32 | const path = `/${type}/${len}`; |
| 33 | |
| 34 | bench.http({ |
| 35 | path: path, |
| 36 | connections: c, |
| 37 | duration, |
| 38 | }, () => { |
| 39 | w1.destroy(); |
| 40 | w2.destroy(); |
| 41 | }); |
| 42 | }); |
| 43 | }); |
| 44 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…