From b7da194714d27b3eda49c32cd58019949eadbc1f Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Tue, 14 Jan 2020 10:03:19 -0800 Subject: [PATCH] benchmark: support optional headers with wrk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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  Reviewed-By: Fedor Indutny  Reviewed-By: Ben Noordhuis  Reviewed-By: James M Snell  --- benchmark/_http-benchmarkers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index 7dd06be2655744..821dab2d55e683 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -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; }