mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
benchmark: add simple https benchmark
Adds a simple benchmark for https server based on the http simple benchmark. Updates benchmarker integration for autocannon and wrk, so that they support https scheme. Also adds a new HTTPS section and improves HTTP/2 section in the benchmark guide. PR-URL: https://github.com/nodejs/node/pull/36612 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
d85ea61c7e
commit
3a11ee88a2
5 files changed
+132
-9
No files matched your search
@@ -0,0 +1,29 @@
|
||||
'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();
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user