-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall.sh
executable file
·75 lines (61 loc) · 1.64 KB
/
runall.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
if [ "$1" == "sync" ]
then
. tests/5producers
for ip in ${IPS[@]}
do
ssh -i pk.pk ubuntu@$ip sudo apt install -y chrony
ssh -i pk.pk ubuntu@$ip 'echo "server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4" > chrony.conf'
ssh -i pk.pk ubuntu@$ip 'sudo cat /etc/chrony/chrony.conf >> chrony.conf'
ssh -i pk.pk ubuntu@$ip 'cat chrony.conf | sudo tee /etc/chrony/chrony.conf'
ssh -i pk.pk ubuntu@$ip sudo /etc/init.d/chrony restart
ssh -i pk.pk ubuntu@$ip sudo chronyd -q
done
exit 0
fi
if [ "$1" == "kill" ]
then
. tests/5producers
for ip in ${IPS[@]}
do
ssh -i pk.pk ubuntu@$ip killall bench
ssh -i pk.pk ubuntu@$ip 'ps -ef | grep bench'
done
exit 0
fi
if [ "$1" == "copy" ]
then
. tests/5producers
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bench .
for ip in ${IPS[@]}
do
scp -i pk.pk ./bench ./run.sh ubuntu@$ip:
done
exit 0
fi
TEST_NAME="${1:-5producers}"
# Load test settings.
. tests/$TEST_NAME
echo "Running $TEST_NAME"
# Start benchmarks on all instances.
for ((i=0;i<${#IPS[@]};i++))
do
echo "Starting ./run.sh ${TOPICS[$i]} at ${IPS[$i]}"
ssh -i pk.pk ubuntu@${IPS[$i]} ./run.sh \"$PARAMS -topics=${TOPICS[$i]}\"
done
# 5 min to run all benchmarks.
sleep 315
mkdir $TEST_NAME
pushd $TEST_NAME
# truncate files
>latencies.csv
>stdout.txt
for ip in ${IPS[@]}
do
echo "copying latencies.csv from $ip"
ssh -i ../pk.pk ubuntu@$ip cat latencies.csv >> latencies.csv
echo "copying bench.out from $ip"
ssh -i ../pk.pk ubuntu@$ip cat bench.out >> stdout.txt
done
cat stdout.txt
popd