Skip to content

Commit

Permalink
folder restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
AhadAli01 committed Mar 3, 2024
1 parent 4c402d5 commit 1e34f57
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
55 changes: 55 additions & 0 deletions scripts/numberOfIterations/sharedIterations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import http from 'k6/http';
import { group, sleep } from 'k6';

const BASE_URL = `http://${__ENV.HOST || 'localhost'}:8080/tools.descartes.teastore.webui`;

const groupResponseTimes = {};


export const options = {
discardResponseBodies: true,
scenarios: {
initialBrowse: {
executor: 'shared-iterations',
vus: 10,
iterations: 200,
maxDuration: '30s',
},
increaseIterations: {
executor: 'shared-iterations',
vus: 10,
iterations: 400,
maxDuration: '60s',
},
increaseVUs: {
executor: 'shared-iterations',
vus: 50,
iterations: 200,
maxDuration: '30s',
},
increaseIterations2: {
executor: 'shared-iterations',
vus: 10,
iterations: 800,
maxDuration: '120s',
},
increaseVUs2: {
executor: 'shared-iterations',
vus: 100,
iterations: 200,
maxDuration: '30s',
},
},
};

export default function () {
group('Black Tea Category Browse', () => {
const start = new Date();
http.get(`${BASE_URL}/category?category=2&page=1`);
const end = new Date();
const duration = end - start;
groupResponseTimes['Black Tea Category Browse'] = (groupResponseTimes['Black Tea Category Browse'] || 0) + duration;
// Sleep time is 1000ms. Total iteration time is sleep + time to finish request.
sleep(1);
});
}

0 comments on commit 1e34f57

Please sign in to comment.