-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/99 reservation spike test (#121)
- Loading branch information
Showing
20 changed files
with
325 additions
and
125 deletions.
There are no files selected for viewing
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
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
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
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
59 changes: 59 additions & 0 deletions
59
src/performanceTest/scripts/breakdownTest/breakdownTest.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { check } from "k6"; | ||
import Request from "../lib/request.js"; | ||
import { encode } from "../lib/jwt.js"; | ||
import hooks from "../lib/hooks.js"; | ||
import generator from "../lib/generator.js"; | ||
import { isSuccess, randomInt, isAlreadReservedAll } from "../lib/helpers.js"; | ||
|
||
export const setup = hooks.setup | ||
export const handleSummary = hooks.handleSummary | ||
|
||
export const options = { | ||
tags: { | ||
testid: `${__ENV.ENTRYPOINT}` | ||
}, | ||
ext: { | ||
loadimpact: { | ||
apm: [ | ||
{ | ||
includeTestRunId: true, | ||
} | ||
] | ||
} | ||
}, | ||
|
||
executor: 'ramping-arrival-rate', //Assure load increase if the system slows | ||
stages: [ | ||
{ duration: '30m', target: 10000 }, // just slowly ramp-up to a HUGE load | ||
], | ||
|
||
thresholds: { | ||
http_req_failed: ['rate<0.01'], // http errors should be less than 1% | ||
http_req_duration: ['p(95)<300'], // 95% of requests should be below 300ms | ||
}, | ||
}; | ||
|
||
|
||
export default function () { | ||
const req = new Request() | ||
|
||
const ID = randomInt(1, 1000000) | ||
req.setToken(encode(ID)) | ||
|
||
const query = { | ||
size: 20, | ||
page: 0, | ||
sort: "id,asc" | ||
} | ||
for (let i = 0; i < 13; i++) { | ||
check(req.getEvents(query), {"Success Get Events": isSuccess}); | ||
query.page = query.page + randomInt(1, 10) | ||
} | ||
|
||
const eventId = 98 // maxAttendees = 191 | ||
check(req.getEvent(eventId), {"EVENT 98 maxAttendees = 191": (r) => r.json().data.maxAttendees === 191}) | ||
|
||
const res = req.createReservation(generator.Reservation(eventId)) | ||
check(res, {"Success Reservation": isSuccess}); | ||
check(res, {"Already reserved": isAlreadReservedAll}); | ||
} |
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
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
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
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
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
12 changes: 6 additions & 6 deletions
12
...erformanceTest/scripts/check/makeUsers.js → src/performanceTest/scripts/makeUsers.js
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
File renamed without changes.
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
Oops, something went wrong.