-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: randomize the iteration interval
- Loading branch information
Showing
3 changed files
with
33 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
The tests use [k6](https://k6.io/) to perform load testing. | ||
|
||
# To run the test | ||
|
||
Set the following environment variables to point to the deployment. | ||
|
||
``` | ||
export WEBAPP_URI=<webapp_uri> | ||
export SEARCH_API_URI=<search_api_uri> | ||
``` | ||
|
||
Once set, you can now run load tests using the following command: | ||
|
||
``` | ||
npm run test:load | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
export const thresholdsSettings = { | ||
'http_req_failed{type:API}': [{ threshold: 'rate<0.01' }], // less than 1% failed requests | ||
'http_req_failed{type:content}': [{ threshold: 'rate<0.01' }], // less than 1% failed requests | ||
'http_req_duration{type:API}': ['p(95)<30000'], // 95% of the API requests must complete below 30s | ||
'http_req_duration{type:content}': ['p(99)<500'], // 99% of the content requests must complete below 500ms | ||
'http_req_duration{type:API}': ['p(90)<40000'], // 90% of the API requests must complete below 40s | ||
'http_req_duration{type:content}': ['p(99)<200'], // 99% of the content requests must complete below 200ms | ||
}; | ||
|
||
// 5.00 iterations/s for 1m0s (maxVUs: 50-100, gracefulStop: 30s) | ||
export const standardWorkload = { | ||
executor: 'per-vu-iterations', | ||
vus: 50, | ||
iterations: 50, | ||
maxDuration: '50s', | ||
}; | ||
|
||
export const heavyWorkload = { | ||
executor: 'ramping-vus', | ||
stages: [ | ||
{ duration: '10s', target: 20 }, | ||
{ duration: '50s', target: 20 }, | ||
{ duration: '50s', target: 40 }, | ||
{ duration: '50s', target: 60 }, | ||
{ duration: '50s', target: 80 }, | ||
{ duration: '50s', target: 100 }, | ||
{ duration: '50s', target: 120 }, | ||
{ duration: '50s', target: 140 }, | ||
], | ||
executor: 'constant-arrival-rate', | ||
rate: 5, | ||
timeUnit: '1s', | ||
duration: '1m', | ||
preAllocatedVUs: 50, | ||
maxVUs: 100, | ||
}; |