Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark: refactor _http-benchmarkers.js #25803

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AutocannonBenchmarker {
'-c', options.connections,
'-j',
'-n',
`http://127.0.0.1:${options.port}${options.path}`
`http://127.0.0.1:${options.port}${options.path}`,
];
const child = child_process.spawn(this.executable, args);
return child;
Expand Down Expand Up @@ -59,7 +59,7 @@ class WrkBenchmarker {
'-d', options.duration,
'-c', options.connections,
'-t', 8,
`http://127.0.0.1:${options.port}${options.path}`
`http://127.0.0.1:${options.port}${options.path}`,
];
const child = child_process.spawn(this.executable, args);
return child;
Expand Down Expand Up @@ -170,7 +170,7 @@ const http_benchmarkers = [
new AutocannonBenchmarker(),
new TestDoubleBenchmarker('http'),
new TestDoubleBenchmarker('http2'),
new H2LoadBenchmarker()
new H2LoadBenchmarker(),
];

const benchmarkers = {};
Expand All @@ -188,7 +188,7 @@ exports.run = function(options, callback) {
path: '/',
connections: 100,
duration: 5,
benchmarker: exports.default_http_benchmarker
benchmarker: exports.default_http_benchmarker,
}, options);
if (!options.benchmarker) {
callback(new Error('Could not locate required http benchmarker. See ' +
Expand Down Expand Up @@ -216,7 +216,7 @@ exports.run = function(options, callback) {
let stdout = '';
child.stdout.on('data', (chunk) => stdout += chunk.toString());

child.once('close', function(code) {
child.once('close', (code) => {
const elapsed = process.hrtime(benchmarker_start);
if (code) {
let error_message = `${options.benchmarker} failed with ${code}.`;
Expand Down