- Login
/auth/login
- Sign up
/auth/signup
- List item
/items
- Get one item
/items/:id
- Place an order
/orders
- NodeJS > v18
- MySQL
- Python3
- K6
- Prisma ORM
To perform load testing with K6, first install K6 following the instructions at https://k6.io/docs/get-started/installation/.
Then, run your K6 test scripts with:
k6 run script.js
Replace script.js with the path to your K6 test script.
Explaination
represent the number of concurrent request / concurrent user that will hit the API
represent the number of request being made to the API
the duration of how long test should be run
some set of rules to determine if the test is successful or not
to determine the number of user increment and decrement based on time
place this piece of code in the code __ENV.K6_DURATION
usage
K6_DURATION=10s k6 run script.js
https://k6.io/docs/using-k6/test-lifecycle/#overview-of-the-lifecycle-stages
// 1. init code
export function setup() {
// 2. setup code
}
export default function (data) {
// 3. VU code
}
export function teardown(data) {
// 4. teardown code
}
Slide: https://docs.google.com/presentation/d/1v5RqN5QDJhUxRz5FfumMfa83aA-nbcO1ysrc6LXfUQ8/edit?usp=sharing