grafana/devenv/docker/loadtest/run.sh
Anthony Woods f56f54b1a3 Auth: Rotate auth tokens at the end of requests (#21347)
By rotating the auth tokens at the end of the request we ensure
that there is minimum delay between a new token being generated
and the client receiving it.
Adds auth token slow load test which uses random latency for all 
tsdb queries..
Cleans up datasource proxy response handling.
DefaultHandler in middleware tests should write a response, the 
responseWriter BeforeFuncs wont get executed unless a response
is written.

Fixes #18644 

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-01-15 13:03:12 +01:00

37 lines
673 B
Bash
Executable File

#/bin/bash
PWD=$(pwd)
run() {
duration='15m'
url='http://localhost:3000'
vus='2'
testcase='auth_token_test'
slowQuery=''
while getopts ":d:u:v:c:s:" o; do
case "${o}" in
d)
duration=${OPTARG}
;;
u)
url=${OPTARG}
;;
v)
vus=${OPTARG}
;;
c)
testcase=${OPTARG}
;;
s)
slowQuery=${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
}
run "$@"