• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common.js');
3
4const bench = common.createBenchmark(main, {
5  type: ['bytes', 'buffer'],
6  len: [4, 1024, 102400],
7  chunks: [1, 4],
8  c: [50, 500],
9  chunkedEnc: [1, 0],
10  benchmarker: ['test-double-https'],
11  duration: 5
12});
13
14function main({ type, len, chunks, c, chunkedEnc, duration }) {
15  const server = require('../fixtures/simple-https-server.js')
16  .listen(common.PORT)
17  .on('listening', () => {
18    const path = `/${type}/${len}/${chunks}/${chunkedEnc}`;
19
20    bench.http({
21      path,
22      connections: c,
23      scheme: 'https',
24      duration
25    }, () => {
26      server.close();
27    });
28  });
29}
30