diff options
Diffstat (limited to 'benchmark/http/client-request-body.js')
-rw-r--r-- | benchmark/http/client-request-body.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js index d521c8a2c8..a6849580cf 100644 --- a/benchmark/http/client-request-body.js +++ b/benchmark/http/client-request-body.js @@ -1,10 +1,10 @@ // Measure the time it takes for the HTTP client to send a request body. 'use strict'; -var common = require('../common.js'); -var http = require('http'); +const common = require('../common.js'); +const http = require('http'); -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { dur: [5], type: ['asc', 'utf', 'buf'], len: [32, 256, 1024], @@ -12,8 +12,8 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - var dur = +conf.dur; - var len = +conf.len; + const dur = +conf.dur; + const len = +conf.len; var encoding; var chunk; @@ -31,7 +31,7 @@ function main(conf) { } var nreqs = 0; - var options = { + const options = { headers: { 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked' }, agent: new http.Agent({ maxSockets: 1 }), host: '127.0.0.1', @@ -40,7 +40,7 @@ function main(conf) { method: 'POST' }; - var server = http.createServer(function(req, res) { + const server = http.createServer(function(req, res) { res.end(); }); server.listen(options.port, options.host, function() { @@ -50,7 +50,7 @@ function main(conf) { }); function pummel() { - var req = http.request(options, function(res) { + const req = http.request(options, function(res) { nreqs++; pummel(); // Line up next request. res.resume(); |