Skip to content

Commit

Permalink
feat(samples): changed sampling rate and length
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed May 23, 2024
1 parent c4cb648 commit 1d7168a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions samples/static/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down

0 comments on commit 1d7168a

Please sign in to comment.