From 1d7168ae1190e592d38261b7cad36d17d2d429c6 Mon Sep 17 00:00:00 2001 From: ArnaudBuchholz Date: Thu, 23 May 2024 11:19:00 -0400 Subject: [PATCH] feat(samples): changed sampling rate and length --- samples/static/benchmark.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/samples/static/benchmark.js b/samples/static/benchmark.js index e3be39f6..ba152e16 100644 --- a/samples/static/benchmark.js +++ b/samples/static/benchmark.js @@ -4,11 +4,16 @@ const autocannon = require('autocannon') const ports = require('./ports.js') async function test (name, url) { - for (const portName of Object.keys(ports)) { - const port = ports[portName] - const impl = /^(.*)_PORT/.exec(portName)[1].toLocaleLowerCase() - for (let measure = 0; measure < 3; ++measure) { - const result = await autocannon({ url: `http://localhost:${port}${url}` }) + for (let measure = 0; measure < 10; ++measure) { + for (const portName of Object.keys(ports)) { + const port = ports[portName] + const impl = /^(.*)_PORT/.exec(portName)[1].toLocaleLowerCase() + const result = await autocannon({ + url: `http://localhost:${port}${url}`, + connections: 10, //default + pipelining: 1, // default + duration: 10 // default + }) if (result.non2xx !== 0) { throw new Error(`Non 2xx results on ${name} for ${impl}`) }