forked from bigchaindb/BEPs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtest.sh
executable file
·61 lines (51 loc) · 1.02 KB
/
runtest.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
#!/bin/bash
export TMHOME=mktemp
init_tendermint () {
rm -rf ${TMHOME}/*
tendermint init 1>&2
}
run_benchmark () {
while : ; do
tm-bench -T $2 -r $3 -c $4 localhost:46657
if [ $? -eq 0 ]; then
break
fi
BENCH_PID=$!
sleep 0.5
done
}
run_internal () {
tendermint node --proxy_app=kvstore --log_level="$1" 1>&2 &
TM_PID=$!
}
run_external () {
tendermint node --log_level="$1" 1>&2 &
TM_PID=$!
abci-cli kvstore 1>&2 &
ABCI_PID=$!
}
if [ "$5" == "no" ];
then
LOGGING=*:error
else
LOGGING=main:info,state:info,*:error
fi
case "$1" in
internal)
init_tendermint
sed -i "s/^size = 100000/size = $6/" ~/mktemp/config/config.toml
run_internal ${LOGGING}
run_benchmark $1 $2 $3 $4 ${LOGGING}
kill ${TM_PID}
;;
external)
init_tendermint
sed -i "s/^size = 100000/size = $6/" ~/mktemp/config/config.toml
run_external ${LOGGING}
run_benchmark $1 $2 $3 $4 ${LOGGING}
kill ${TM_PID} ${ABCI_PID}
;;
*)
echo $"Usage: $0 {internal|external} <time> <requests> <concurrency> <logging>"
exit 1
esac