Skip to content

Commit

Permalink
benchmark: support optional headers with wrk
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
sam-github authored and BethGriggs committed Feb 1, 2020
1 parent d617fdf commit 209767c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class WrkBenchmarker {
'-t', 8,
`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);
return child;
}
Expand Down

0 comments on commit 209767c

Please sign in to comment.