mirror of https://github.com/nodejs/node.git
benchmark: support optional headers with wrk
wrk did not support sending optional headers, they were silently ignored. This appears to be an oversight, they were supported for autocannon. PR-URL: https://github.com/nodejs-private/node-private/pull/189 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>pull/31318/head
parent
06a43d4dca
commit
f8e7551295
|
@ -64,6 +64,9 @@ class WrkBenchmarker {
|
||||||
'-t', 8,
|
'-t', 8,
|
||||||
`http://127.0.0.1:${options.port}${options.path}`,
|
`http://127.0.0.1:${options.port}${options.path}`,
|
||||||
];
|
];
|
||||||
|
for (const field in options.headers) {
|
||||||
|
args.push('-H', `${field}: ${options.headers[field]}`);
|
||||||
|
}
|
||||||
const child = child_process.spawn(this.executable, args);
|
const child = child_process.spawn(this.executable, args);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue