Skip to content

Commit 40398fd

Browse files
Trottaddaleax
authored andcommitted
benchmark: refactor _http-benchmarkers.js
Refactor _http-benchmarkers.js: * The file used a mixture of inline callbacks with the `function` keyword and arrow functions. Use arrow functions for consistency. * The file used a mixture of trailing commas and no trailing commas. Use trailing commas for consistency. PR-URL: #25803 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7a1f166 commit 40398fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

benchmark/_http-benchmarkers.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AutocannonBenchmarker {
2525
'-c', options.connections,
2626
'-j',
2727
'-n',
28-
`http://127.0.0.1:${options.port}${options.path}`
28+
`http://127.0.0.1:${options.port}${options.path}`,
2929
];
3030
const child = child_process.spawn(this.executable, args);
3131
return child;
@@ -59,7 +59,7 @@ class WrkBenchmarker {
5959
'-d', options.duration,
6060
'-c', options.connections,
6161
'-t', 8,
62-
`http://127.0.0.1:${options.port}${options.path}`
62+
`http://127.0.0.1:${options.port}${options.path}`,
6363
];
6464
const child = child_process.spawn(this.executable, args);
6565
return child;
@@ -170,7 +170,7 @@ const http_benchmarkers = [
170170
new AutocannonBenchmarker(),
171171
new TestDoubleBenchmarker('http'),
172172
new TestDoubleBenchmarker('http2'),
173-
new H2LoadBenchmarker()
173+
new H2LoadBenchmarker(),
174174
];
175175

176176
const benchmarkers = {};
@@ -188,7 +188,7 @@ exports.run = function(options, callback) {
188188
path: '/',
189189
connections: 100,
190190
duration: 5,
191-
benchmarker: exports.default_http_benchmarker
191+
benchmarker: exports.default_http_benchmarker,
192192
}, options);
193193
if (!options.benchmarker) {
194194
callback(new Error('Could not locate required http benchmarker. See ' +
@@ -216,7 +216,7 @@ exports.run = function(options, callback) {
216216
let stdout = '';
217217
child.stdout.on('data', (chunk) => stdout += chunk.toString());
218218

219-
child.once('close', function(code) {
219+
child.once('close', (code) => {
220220
const elapsed = process.hrtime(benchmarker_start);
221221
if (code) {
222222
let error_message = `${options.benchmarker} failed with ${code}.`;

0 commit comments

Comments
 (0)