Skip to content

Commit 209767c

Browse files
sam-githubBethGriggs
authored andcommitted
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: nodejs-private/node-private#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>
1 parent d617fdf commit 209767c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

benchmark/_http-benchmarkers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class WrkBenchmarker {
6464
'-t', 8,
6565
`http://127.0.0.1:${options.port}${options.path}`,
6666
];
67+
for (const field in options.headers) {
68+
args.push('-H', `${field}: ${options.headers[field]}`);
69+
}
6770
const child = child_process.spawn(this.executable, args);
6871
return child;
6972
}

0 commit comments

Comments
 (0)