Skip to content

Commit

Permalink
Add new query for performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
pylipp committed Aug 21, 2022
1 parent f70accc commit e6c7657
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions back/scripts/load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ const payload = JSON.stringify({
// query: "query { beneficiary(id: 1007) { firstName } }",

// B) Request single field of multiple resources
query: "query { beneficiaries { elements { firstName } } }",
// query: "query { beneficiaries { elements { firstName } } }",

// C) All boxes for base
// query: "query { base(id: 1) { locations { name boxes { totalCount elements { labelIdentifier state size { id label } product { gender name } tags { name id } items } } } } }",
query: "query { location(id: 1) { boxes { elements { product { gender name } } } } }",
});

export const options = {
scenarios: {
/*
shared: {
executor: 'shared-iterations',

Expand All @@ -45,11 +48,11 @@ export const options = {
gracefulStop: '5s',

// executor-specific configuration
vus: 10,
iterations: 100,
vus: 1,
iterations: 1,
// maxDuration: '10s',
},
*/
/*
ramping: {
executor: "ramping-vus",
startVUs: 0,
Expand All @@ -60,14 +63,15 @@ export const options = {
],
gracefulRampDown: "0s",
},
*/
},
};

export default function () {
const res = http.post(url, payload, params);

// Use in combination with A/B to assert working auth
// check(res, { 'is status 200': (r) => r.status === 200, });
check(res, { 'is status 200': (r) => r.status === 200, });

// Use in combination with A
// check(res, { 'has correct firstName': (r) => r.json().data.beneficiary.firstName === "Kailyn", });
Expand Down

0 comments on commit e6c7657

Please sign in to comment.