Update tests
This commit is contained in:
parent
ee2ac342e1
commit
03aedd9564
3 changed files with 4 additions and 7 deletions
|
@ -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.
|
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
|
```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
|
## Simple Test
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const options = {
|
||||||
{ duration: '5m', target: 0 }, // ramp-down to 0 users
|
{ duration: '5m', target: 0 }, // ramp-down to 0 users
|
||||||
],
|
],
|
||||||
thresholds: {
|
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
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
import http from 'k6/http';
|
import http from 'k6/http';
|
||||||
|
|
||||||
var hostname = __ENV.HOSTNAME;
|
|
||||||
if (hostname == null) hostname = 'localhost:5157';
|
|
||||||
|
|
||||||
export const options = {
|
export const options = {
|
||||||
vus: 1,
|
vus: 1,
|
||||||
duration: '10s'
|
duration: '2s'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
http.get(`http://${hostname}/age/1987-09-01`);
|
http.get('http://localhost:5157/age/1990-01-01');
|
||||||
};
|
};
|
Loading…
Reference in a new issue