Created
July 31, 2022 08:36
-
-
Save jamal-abbasi/16925763e93b3e4a8f28970c403125ec to your computer and use it in GitHub Desktop.
Autocannon script used to stress tests the api's with clinicjs to see the quality issues in code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const autocannon = require('autocannon') | |
function startBench() { | |
const url = 'http://localhost:10105'; | |
autocannon({ | |
url, | |
connections: 10, //default | |
pipelining: 1, // default | |
duration: 10, // default | |
headers: { | |
"Content-Type": 'application/json', | |
"authorization": '' | |
}, | |
requests : [ | |
{ | |
method: 'GET', | |
path: '/',//api url | |
} | |
] | |
}, finishedBench); | |
} | |
function finishedBench(err, res) { | |
console.log('finished bench', err, res); | |
}; | |
startBench(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment