Update tests

This commit is contained in:
Alex Hyett 2023-09-27 12:22:11 +01:00
parent ee2ac342e1
commit 03aedd9564
3 changed files with 4 additions and 7 deletions

View file

@ -19,7 +19,7 @@ Then in a seperate terminal window run the tests using the commands below.
Note if you want to run these scripts against an API hosted on another machine you can use the HOSTNAME environment variable. e.g.
```sh
k6 run -e HOSTNAME=192.168.1.1:5157 tests/simple-test.js
k6 run -e HOSTNAME=192.168.1.1:5157 tests/stress-test.js
```
## Simple Test

View file

@ -12,7 +12,7 @@ export const options = {
{ duration: '5m', target: 0 }, // ramp-down to 0 users
],
thresholds: {
http_req_duration: ['p(99)<10'], // 99% of requests must complete within 10ms
http_req_duration: ['p(99)<100'], // 99% of requests must complete within 100ms
}
};

View file

@ -1,13 +1,10 @@
import http from 'k6/http';
var hostname = __ENV.HOSTNAME;
if (hostname == null) hostname = 'localhost:5157';
export const options = {
vus: 1,
duration: '10s'
duration: '2s'
};
export default () => {
http.get(`http://${hostname}/age/1987-09-01`);
http.get('http://localhost:5157/age/1990-01-01');
};