(opts, list, index)
| 76 | } |
| 77 | |
| 78 | function start(opts, list, index) { |
| 79 | index = index || 0; |
| 80 | |
| 81 | // No more item |
| 82 | if (list.length === index) { |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | var handler = list[index]; |
| 87 | console.log('---- ' + handler + ' ----'); |
| 88 | |
| 89 | pipeline( |
| 90 | { |
| 91 | funcs: [ |
| 92 | function head(_, callback) { |
| 93 | runBenchmark(opts, handler, 'head', callback); |
| 94 | }, |
| 95 | function stable(_, callback) { |
| 96 | if (!opts.compare) { |
| 97 | callback(); |
| 98 | return; |
| 99 | } |
| 100 | runBenchmark(opts, handler, 'stable', callback); |
| 101 | } |
| 102 | ] |
| 103 | }, |
| 104 | function onPipelineFinished(err) { |
| 105 | if (err) { |
| 106 | console.log(err); |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | // Compare versions |
| 111 | if (opts.compare) { |
| 112 | var result = autocannon.compare(handler); |
| 113 | |
| 114 | console.log(handler + ' throughput:'); |
| 115 | console.log(JSON.stringify(result.throughput, null, 4) + '\n'); |
| 116 | } |
| 117 | |
| 118 | // Benchmark next handler |
| 119 | start(opts, list, ++index); |
| 120 | } |
| 121 | ); |
| 122 | } |
| 123 | |
| 124 | module.exports = start; |
nothing calls this directly
no test coverage detected