parent
75b8b281b8
commit
aefe5493b0
|
@ -38,13 +38,26 @@ async function postContracts(runners: Runner[]): Promise<Measurement> {
|
|||
return new Measurement("contract", runners.length, parseInt(res.headers['request-duration']))
|
||||
}
|
||||
|
||||
async function testContracts(sizes): Promise<Measurement[]> {
|
||||
let measurements = new Array<Measurement>();
|
||||
console.log("#### Testing contracts ####");
|
||||
|
||||
for (let size of sizes) {
|
||||
const m = await postContracts(generateRunners(size));
|
||||
console.log(m.toString());
|
||||
measurements.push(m);
|
||||
}
|
||||
return measurements;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const sizes = [0, 1, 10, 50, 100, 200, 500, 1000]
|
||||
console.log(`version ${(await axios.get("http://localhost:4010/version")).data.version}`)
|
||||
console.log("Starting tests");
|
||||
for (let size of sizes) {
|
||||
console.log((await (await postContracts(generateRunners(size))).toString()))
|
||||
}
|
||||
console.log("########### Speedtest ###########");
|
||||
console.log(`Document server version (according to the api): ${(await axios.get("http://localhost:4010/version")).data.version}`);
|
||||
console.log("####### Running tests #######");
|
||||
const contractResults = await testContracts(sizes);
|
||||
console.log("####### Results #######");
|
||||
console.table(contractResults);
|
||||
}
|
||||
|
||||
main();
|
||||
|
|
Loading…
Reference in New Issue