mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
benchmark: add test
and all
options and improve errors"
This reverts commit 4671d551cf
and
contains a fix to the issue raised for the revert.
PR-URL: https://github.com/nodejs/node/pull/31755
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
f64aafa2d5
commit
1760c23f75
38 changed files with 306 additions and 201 deletions
|
@ -3,10 +3,11 @@ const common = require('../common.js');
|
|||
|
||||
const bench = common.createBenchmark(main, {
|
||||
asyncHooks: ['init', 'before', 'after', 'all', 'disabled', 'none'],
|
||||
connections: [50, 500]
|
||||
connections: [50, 500],
|
||||
duration: 5
|
||||
});
|
||||
|
||||
function main({ asyncHooks, connections }) {
|
||||
function main({ asyncHooks, connections, duration }) {
|
||||
if (asyncHooks !== 'none') {
|
||||
let hooks = {
|
||||
init() {},
|
||||
|
@ -33,6 +34,7 @@ function main({ asyncHooks, connections }) {
|
|||
bench.http({
|
||||
connections,
|
||||
path,
|
||||
duration
|
||||
}, () => {
|
||||
server.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue