-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·39 lines (30 loc) · 793 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
·39 lines (30 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -e
OPEN_GRAFANA=false
err() {
echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $@" >&2
}
log(){
echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $@" >&1
}
#Open grafana in default browser
openGrafana(){
timeout 60 bash -c '
until (curl --output /dev/null --silent --head --fail http://localhost:3000); do
sleep 1;
done;'
python -mwebbrowser http://localhost:3000/d/metrics/overload > /dev/null &
}
while [ "$1" != "" ]; do
case $1 in
"--open-grafana") shift
OPEN_GRAFANA='true'
;;
esac
shift || true
done
log "Start grafana"
docker-compose up -d grafana
${OPEN_GRAFANA} && log "Open grafana" && openGrafana
log "Start load testing"
docker-compose run --rm tank -qc config.yml