mirror of
https://github.com/nodejs/node.git
synced 2024-11-28 14:33:11 +01:00
ca5f322d32
PR-URL: https://github.com/nodejs/node/pull/46370 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
30 lines
650 B
JavaScript
30 lines
650 B
JavaScript
'use strict';
|
|
const common = require('../common.js');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
type: ['bytes', 'buffer'],
|
|
len: [4, 1024, 102400],
|
|
chunks: [1, 4],
|
|
c: [50, 500],
|
|
chunkedEnc: [1, 0],
|
|
benchmarker: ['test-double-https'],
|
|
duration: 5,
|
|
});
|
|
|
|
function main({ type, len, chunks, c, chunkedEnc, duration }) {
|
|
const server = require('../fixtures/simple-https-server.js')
|
|
.listen(common.PORT)
|
|
.on('listening', () => {
|
|
const path = `/${type}/${len}/${chunks}/${chunkedEnc}`;
|
|
|
|
bench.http({
|
|
path,
|
|
connections: c,
|
|
scheme: 'https',
|
|
duration,
|
|
}, () => {
|
|
server.close();
|
|
});
|
|
});
|
|
}
|