| 178 | } |
| 179 | |
| 180 | http(options, cb) { |
| 181 | const http_options = { ...options }; |
| 182 | http_options.benchmarker ||= this.config.benchmarker || |
| 183 | this.extra_options.benchmarker || |
| 184 | http_benchmarkers.default_http_benchmarker; |
| 185 | http_benchmarkers.run( |
| 186 | http_options, (error, code, used_benchmarker, result, elapsed) => { |
| 187 | if (cb) { |
| 188 | cb(code); |
| 189 | } |
| 190 | if (error) { |
| 191 | console.error(error); |
| 192 | process.exit(code || 1); |
| 193 | } |
| 194 | this.config.benchmarker = used_benchmarker; |
| 195 | this.report(result, elapsed); |
| 196 | }, |
| 197 | ); |
| 198 | } |
| 199 | |
| 200 | _run() { |
| 201 | // If forked, report to the parent. |