# mysql config
# mysql-host=10.3.1.2
# mysql-port=3306
# mysql-user=root
# mysql-password=
# mysql-db=sbtest
# time=300
# report-interval=1800


#!/bin/sh
function redEcho()
{
  datastr=`date +"%m-%d %H:%M:%S"`
  echo -e "\033[31m $1 <$datastr\033[0m"
}

ttypes=("oltp_point_select" "oltp_read_write" "oltp_write_only" "oltp_update_index" "oltp_update_non_index")
#threads=(32 128 256 512 1024 2048)
threads=1024

for tn in ${threads[@]};
do
  for t in ${ttypes[@]};
  do
    redEcho "sysbench --config-file=config --tables=32 --table-size=10000000 --threads=$tn $t run \n"
    sysbench --config-file=config --tables=32 --table-size=10000000 --threads=$tn $t run
    sleep 60
    echo ""
    echo "-----------------------------------------------------------------------------------------------------------------"
  done;
done;
redEcho "finish"