added out option (#24052)

* added out option

* Added example in readme
pull/24083/head
Jon Gyllenswärd 5 years ago committed by GitHub
parent 55ac97dccc
commit f2254081c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      devenv/docker/loadtest/README.md
  2. 8
      devenv/docker/loadtest/run.sh

@ -35,6 +35,12 @@ Run load test for 10 virtual users:
$ ./run.sh -v 10
```
Run load test and send the results to the database "myDb" in influxDB running locally on port 8086 (with no authentication):
```bash
$ ./run.sh -o influxdb=http://localhost:8086/myDb
```
Run auth token slow test (random query latency between 1 and 30 seconds):
```bash

@ -8,8 +8,9 @@ run() {
vus='2'
testcase='auth_token_test'
slowQuery=''
out=''
while getopts ":d:u:v:c:s:" o; do
while getopts ":d:u:v:c:s:o:" o; do
case "${o}" in
d)
duration=${OPTARG}
@ -26,11 +27,14 @@ run() {
s)
slowQuery=${OPTARG}
;;
o) out=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
docker run -t --network=host -v $PWD:/src -e URL=$url -e SLOW_QUERY=$slowQuery --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/$testcase.js
docker run -t --network=host -v $PWD:/src -e URL=$url -e SLOW_QUERY=$slowQuery -e K6_OUT=$out --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/$testcase.js
}
run "$@"

Loading…
Cancel
Save