Commit f2254081 by Jon Gyllenswärd Committed by GitHub

added out option (#24052)

* added out option

* Added example in readme
parent 55ac97dc
...@@ -35,6 +35,12 @@ Run load test for 10 virtual users: ...@@ -35,6 +35,12 @@ Run load test for 10 virtual users:
$ ./run.sh -v 10 $ ./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): Run auth token slow test (random query latency between 1 and 30 seconds):
```bash ```bash
......
...@@ -8,8 +8,9 @@ run() { ...@@ -8,8 +8,9 @@ run() {
vus='2' vus='2'
testcase='auth_token_test' testcase='auth_token_test'
slowQuery='' slowQuery=''
out=''
while getopts ":d:u:v:c:s:" o; do while getopts ":d:u:v:c:s:o:" o; do
case "${o}" in case "${o}" in
d) d)
duration=${OPTARG} duration=${OPTARG}
...@@ -26,11 +27,14 @@ run() { ...@@ -26,11 +27,14 @@ run() {
s) s)
slowQuery=${OPTARG} slowQuery=${OPTARG}
;; ;;
o) out=${OPTARG}
;;
esac esac
done done
shift $((OPTIND-1)) 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 "$@" run "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment