diff --git a/conf/performance/tpc-e.conf b/conf/performance/tpc-e.conf new file mode 100644 index 0000000000000000000000000000000000000000..f3828f4219c9f927e8c3b79da4e993e70f6c7598 --- /dev/null +++ b/conf/performance/tpc-e.conf @@ -0,0 +1,6 @@ +database concurrent customer duration +postgresql 30 NA 120 +postgresql 10 5000 600 +postgresql 30 10000 120 +mysql 30 NA 120 +oracle 30 NA 120 \ No newline at end of file diff --git a/conf/performance/tpc-h.conf b/conf/performance/tpc-h.conf new file mode 100644 index 0000000000000000000000000000000000000000..d28e3474f085b30c21da0e3112b4af8170a73df7 --- /dev/null +++ b/conf/performance/tpc-h.conf @@ -0,0 +1,2 @@ +database SF N +postgresql 1 10 \ No newline at end of file diff --git a/tests/tpc-e/README.md b/tests/tpc-e/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8ca596c4957f3b3bb1373f46f90505e536f9c939 --- /dev/null +++ b/tests/tpc-e/README.md @@ -0,0 +1,28 @@ +# TPC-E Benchmark + +## Description +TPC-e is used to test the benchmark of databases, currently, it support mysql, postgresql and oracle. + +## Homepage + +## Version + +## Category +performance + +## Parameters +- concurrent: concurrent connection +- duration: times to be run + +## Results +tpse: xxx + +## Manual Run + +**Offline:** + +1. copy `tpc-ebenchmark` to `$TONE_ROOT/cache/tpc-e/` +2. prepare `/etc/odbc.ini` +3. fetch: `tone fetch tpc-e` +4. install: `tone install tpc-e` +5. run: `tone run tpc-e:database=postgresql,concurrent=30,duration=120` \ No newline at end of file diff --git a/tests/tpc-e/install.sh b/tests/tpc-e/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a7aaaa9c0de708e1382c64187d556c2c1806c77 --- /dev/null +++ b/tests/tpc-e/install.sh @@ -0,0 +1,25 @@ +GIT_URL="http://192.168.16.26/chenshuo/tpc-ebenchmark.git" + +DEP_PKG_LIST="cmake python3 R python3-pip python3-devel gcc gcc-c++ expect" + +#extract_src() +#{ +# logger yum update -y anolis-repos +# logger yum install -y epel-release +#} + +build() +{ + echo "Nothing to build ..." +} + +install() +{ + echo "Just copy file to /opt/tpc-ebenchmark" + if [ -d "/opt/tpc-ebenchmark" ]; then + rm -rf /opt/tpc-ebenchmark + fi + + mkdir /opt/tpc-ebenchmark + cp -r * /opt/tpc-ebenchmark/ +} diff --git a/tests/tpc-e/run.sh b/tests/tpc-e/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4870179fccb535c6ae2b28c5e71c624b546d8a1 --- /dev/null +++ b/tests/tpc-e/run.sh @@ -0,0 +1,52 @@ +#!/bin/bash +. $TONE_ROOT/lib/common.sh +. $TONE_ROOT/lib/testinfo.sh + +run() { + echo "install rpy2 via pip3" + logger pip3 install -U rpy2 + + echo "Install unixODBC-2.3.9" + cd /opt/tpc-ebenchmark/utils/unixodbc + logger ./odbc-install.sh + source ./odbc-config.sh + + echo "Prep odbc.ini" + if [ "$database" = "postgresql" ]; then + echo "[postgresql]" > /opt/unixodbc/etc/odbc.ini + echo "Driver = PostgreSQL" >> /opt/unixodbc/etc/odbc.ini + echo "Database = tpce" >> /opt/unixodbc/etc/odbc.ini + echo "Servername = $DBSERVER" >> /opt/unixodbc/etc/odbc.ini + echo "UserName = postgres" >> /opt/unixodbc/etc/odbc.ini + echo "Password = postgres" >> /opt/unixodbc/etc/odbc.ini + echo "Port = 5432" >> /opt/unixodbc/etc/odbc.ini + elif [ "$database" = "oracle" ]; then + echo "Prep oracle odbc.ini" + elif [ "$database" = "mysql" ]; then + echo "Prep mysql odbc.ini" + else + echo "Not supported database type" + fi + + echo "Check odbcinst informations" + logger odbcinst -j + + echo "Build tpc-e benchmark" + cd /opt/tpc-ebenchmark + logger ./build.sh -t $database + if [ ! -n "$customer" ]; then + customer="5000" + fi + + echo "Run benchmark" + cd /opt/tpc-ebenchmark + rm -rf tmp/results + # logger tpce-run-workload -a $database -n $database -c 5000 -t 5000 -d $duration -u $concurrent -f 500 -w 300 -e 30000 -g 30010 -z 1 -p 0 -v 30 -i -i /opt/tpc-ebenchmark/egen + logger logger tpce-run-workload -a $database -n $database -c $customer -d $duration -u $concurrent -i /opt/tpc-ebenchmark/egen + result_dir=`ls -t /opt/tpc-ebenchmark/tmp/|head -n1|awk '{print $0}'` + cp -r /opt/tpc-ebenchmark/tmp/$result_dir/* $TONE_CURRENT_RESULT_DIR +} + +parse() { + echo `grep "tpse" $TONE_CURRENT_RESULT_DIR/data/00.txt | sed 's/(/\ /g' | awk '{print $1}' | sed 's/=/: /g'` +} diff --git a/tests/tpc-h/install.sh b/tests/tpc-h/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..d835f2d63940f346b08d436785dc2d9550dfcd09 --- /dev/null +++ b/tests/tpc-h/install.sh @@ -0,0 +1,14 @@ +GIT_URL="http://192.168.16.26/chenshuo/tpc-hbenchmark.git" + +DEP_PKG_LIST="gcc" + +build() +{ + echo "Nothing to build ..." +} + +install() +{ + echo "Copy code to run path" + cp -r * $TONE_BM_RUN_DIR/ +} diff --git a/tests/tpc-h/run.sh b/tests/tpc-h/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..6048436c7087f5b714974123a802952c0bf58535 --- /dev/null +++ b/tests/tpc-h/run.sh @@ -0,0 +1,28 @@ +#!/bin/bash +. $TONE_ROOT/lib/common.sh +. $TONE_ROOT/lib/testinfo.sh + +run() { + echo "run power.sh" + chown -R postgres:postgres tpch + chmod 777 tpch/power.sh + chmod 777 tpch/throughput.sh + #logger runuser -l postgres -c '$TONE_BM_RUN_DIR/tpch/power.sh $SF power.log' + + echo "run throughput.sh" + #logger runuser -l postgres -c '$TONE_BM_RUN_DIR/tpch/throughput.sh $SF $N throughput.log' + + echo "Copy result to $TONE_CURRENT_RESULT_DIR" + cp $TONE_BM_RUN_DIR/power.log $TONE_CURRENT_RESULT_DIR/ + cp $TONE_BM_RUN_DIR/throughput.log $TONE_CURRENT_RESULT_DIR/ +} + +parse() { + tpchpower=`grep "tpchpower" $TONE_CURRENT_RESULT_DIR/power.log | awk -F "=" '{print $2}'` + tpchthroughput=`grep "tpchthroughput" $TONE_CURRENT_RESULT_DIR/throughput.log | awk -F "=" '{print $2}'` + + echo "Power: $tpchpower" + echo "Throughput: $tpchthroughput" + qphh=`awk 'BEGIN{printf sqrt('$tpchpower'*'$tpchthroughput')}'` + echo "QphH: $qphh" +} \ No newline at end of file diff --git a/tone b/tone index 09093301bc7092825d6c9426703a3bd31e09ee0b..20603b6859232d282ed50c3b0a4e7c02b1f45408 100755 --- a/tone +++ b/tone @@ -3,4 +3,4 @@ from core.tone import run if __name__ == '__main__': - run() \ No newline at end of file + run()