diff --git a/bench/run.sh b/bench/run-dtm.sh similarity index 100% rename from bench/run.sh rename to bench/run-dtm.sh diff --git a/bench/run-mysql.sh b/bench/run-mysql.sh new file mode 100755 index 0000000..f943ae5 --- /dev/null +++ b/bench/run-mysql.sh @@ -0,0 +1,6 @@ +# !/bin/bash + +cd /usr/share/sysbench/ +sysbench oltp_write_only.lua --time=60 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password= --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=10 --events=999999999 --report-interval=10 prepare + +sysbench oltp_write_only.lua --time=60 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password= --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=10 --events=999999999 --report-interval=10 run \ No newline at end of file diff --git a/bench/run-services.sh b/bench/run-services.sh new file mode 100644 index 0000000..a95f9a3 --- /dev/null +++ b/bench/run-services.sh @@ -0,0 +1,5 @@ +# !/bin/bash + +# start all services +docker-compose -f helper/compose.mysql.yml up -d +go run app/main.go bench > /dev/nul \ No newline at end of file diff --git a/bench/setup.sh b/bench/setup.sh new file mode 100755 index 0000000..47e2310 --- /dev/null +++ b/bench/setup.sh @@ -0,0 +1,14 @@ +# !/bin/bash + +# install all commands needed +apt install -y git sysbench apache2-utils mysql-client-core-8.0 + +# install docker and docker-compose +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +chmod +x /usr/local/bin/docker-compose + +# install go +wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz +rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz