summaryrefslogtreecommitdiff
path: root/benchmark/http/client-request-body.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/http/client-request-body.js')
-rw-r--r--benchmark/http/client-request-body.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js
index a6849580cf..49bb9130ae 100644
--- a/benchmark/http/client-request-body.js
+++ b/benchmark/http/client-request-body.js
@@ -11,13 +11,10 @@ const bench = common.createBenchmark(main, {
method: ['write', 'end']
});
-function main(conf) {
- const dur = +conf.dur;
- const len = +conf.len;
-
+function main({ dur, len, type, method }) {
var encoding;
var chunk;
- switch (conf.type) {
+ switch (type) {
case 'buf':
chunk = Buffer.alloc(len, 'x');
break;
@@ -55,7 +52,7 @@ function main(conf) {
pummel(); // Line up next request.
res.resume();
});
- if (conf.method === 'write') {
+ if (method === 'write') {
req.write(chunk, encoding);
req.end();
} else {