Skip to content

Commit 9b0d503

Browse files
aduh95danielleadams
authored andcommitted
benchmark: add trailing commas in benchmark/http
PR-URL: #46609 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 65b877d commit 9b0d503

14 files changed

+18
-19
lines changed

benchmark/.eslintrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ rules:
99

1010
overrides:
1111
- files:
12-
- http/*.js
1312
- path/*.js
1413
rules:
1514
comma-dangle: [error, {

benchmark/http/bench-parser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const common = require('../common');
44

55
const bench = common.createBenchmark(main, {
66
len: [4, 8, 16, 32],
7-
n: [1e5]
7+
n: [1e5],
88
}, {
9-
flags: ['--expose-internals', '--no-warnings']
9+
flags: ['--expose-internals', '--no-warnings'],
1010
});
1111

1212
function main({ len, n }) {

benchmark/http/check_invalid_header_char.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const groupedInputs = {
2323

2424
// Put it here so the benchmark result lines will not be super long.
2525
LONG_AND_INVALID: ['Here is a value that is really a folded header ' +
26-
'value\r\n this should be supported, but it is not currently']
26+
'value\r\n this should be supported, but it is not currently'],
2727
};
2828

2929
const inputs = [

benchmark/http/chunked.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const bench = common.createBenchmark(main, {
1414
n: [1, 4, 8, 16],
1515
len: [1, 64, 256],
1616
c: [100],
17-
duration: 5
17+
duration: 5,
1818
});
1919

2020
function main({ len, n, c, duration }) {

benchmark/http/client-request-body.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
88
dur: [5],
99
type: ['asc', 'utf', 'buf'],
1010
len: [32, 256, 1024],
11-
method: ['write', 'end']
11+
method: ['write', 'end'],
1212
});
1313

1414
function main({ dur, len, type, method }) {
@@ -33,7 +33,7 @@ function main({ dur, len, type, method }) {
3333
agent: new http.Agent({ maxSockets: 1 }),
3434
host: '127.0.0.1',
3535
path: '/',
36-
method: 'POST'
36+
method: 'POST',
3737
};
3838

3939
const server = http.createServer((req, res) => {

benchmark/http/cluster.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function main({ type, len, c, duration }) {
3434
bench.http({
3535
path: path,
3636
connections: c,
37-
duration
37+
duration,
3838
}, () => {
3939
w1.destroy();
4040
w2.destroy();

benchmark/http/create-clientrequest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
1111
// Use 'url' to avoid name clash with other http benchmark
1212
url: types.concat(['wpt']),
1313
arg: ['URL', 'string', 'options'],
14-
e: [1]
14+
e: [1],
1515
});
1616

1717
function noop() {}
@@ -25,7 +25,7 @@ function main({ url: type, arg, e }) {
2525
switch (arg) {
2626
case 'options': {
2727
const options = data.map((i) => ({
28-
path: new URL(i).path, createConnection: noop
28+
path: new URL(i).path, createConnection: noop,
2929
}));
3030
bench.start();
3131
for (let i = 0; i < len; i++) {

benchmark/http/end-vs-write-end.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, {
1515
len: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024],
1616
c: [100],
1717
method: ['write', 'end'],
18-
duration: 5
18+
duration: 5,
1919
});
2020

2121
function main({ len, type, method, c, duration }) {

benchmark/http/headers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const http = require('http');
66
const bench = common.createBenchmark(main, {
77
n: [10, 600],
88
len: [1, 100],
9-
duration: 5
9+
duration: 5,
1010
});
1111

1212
function main({ len, n, duration }) {

benchmark/http/http_server_for_chunky_client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tmpdir.refresh();
1515
const server = http.createServer({ maxHeaderSize: 64000 }, (req, res) => {
1616
const headers = {
1717
'content-type': 'text/plain',
18-
'content-length': '2'
18+
'content-length': '2',
1919
};
2020
res.writeHead(200, headers);
2121
res.end('ok');
@@ -28,7 +28,7 @@ server.listen(PIPE);
2828

2929
const child = fork(
3030
`${__dirname}/_chunky_http_client.js`,
31-
process.argv.slice(2)
31+
process.argv.slice(2),
3232
);
3333
child.on('message', (data) => {
3434
if (data.type === 'report') {

benchmark/http/incoming_headers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, {
66
connections: [50], // Concurrent connections
77
headers: [20], // Number of header lines to append after the common headers
88
w: [0, 6], // Amount of trailing whitespace
9-
duration: 5
9+
duration: 5,
1010
});
1111

1212
function main({ connections, headers, w, duration }) {
@@ -20,7 +20,7 @@ function main({ connections, headers, w, duration }) {
2020
'Accept': 'text/plain',
2121
'User-Agent': 'nodejs-benchmark',
2222
'Date': new Date().toString(),
23-
'Cache-Control': 'no-cache'
23+
'Cache-Control': 'no-cache',
2424
};
2525
for (let i = 0; i < headers; i++) {
2626
// Note:

benchmark/http/set-header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const common = require('../common.js');
33

44
const bench = common.createBenchmark(main, {
55
res: ['normal', 'setHeader', 'setHeaderWH'],
6-
duration: 5
6+
duration: 5,
77
});
88

99
const type = 'bytes';

benchmark/http/simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
88
chunks: [1, 4],
99
c: [50, 500],
1010
chunkedEnc: [1, 0],
11-
duration: 5
11+
duration: 5,
1212
});
1313

1414
function main({ type, len, chunks, c, chunkedEnc, duration }) {

benchmark/http/upgrade.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44
const net = require('net');
55

66
const bench = common.createBenchmark(main, {
7-
n: [5, 1000]
7+
n: [5, 1000],
88
});
99

1010
const reqData = 'GET / HTTP/1.1\r\n' +

0 commit comments

Comments
 (0)