forked from akopytov/sysbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench.sh
30 lines (22 loc) · 1.05 KB
/
bench.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
DIR=~/StarRocksBenchmark/sql/ssb-flat/
truncate -s 0 result.csv
echo "query,concurrency,qps" >> result.csv
for file in $(ls ~/StarRocksBenchmark/sql/ssb-flat/ | grep -v '\.'); do
sql=$(cat $DIR/$file | grep -v '\-\-' | tr '\n' ' ')
# warmup
result=$(src/sysbench src/lua/sr_query.lua run --mysql-host=172.26.194.221 \
--mysql-port=19030 --mysql-user=root --mysql-password="" \
--mysql-db=ssb_100g --report-interval=1 --time=5 \
--threads=1 \
--srquery="$sql" | tee bench.log | grep "eps")
for c in 1 2 4 8 16 32 64; do
echo "running $file concurrency=$c"
result=$(src/sysbench src/lua/sr_query.lua run --mysql-host=172.26.194.221 \
--mysql-port=19030 --mysql-user=root --mysql-password="" \
--mysql-db=ssb_100g --report-interval=1 --time=10 \
--threads=$c \
--srquery="$sql" | tee bench.log | grep "eps")
qps=$(echo $result | perl -nle 'print $1 if /(\d+\.\d+)/')
echo "$file,$c,$qps" | tee -a result.csv
done
done