At file:///Users/hakan/work/monty_program/mariadb-tools/ ------------------------------------------------------------ revno: 15 revision-id: hakan@askmonty.org-20100303194611-t4fs0hb4umjqgmwa parent: hakan@work-20100303192949-4bln75gso2dmncee committer: Hakan Kuecuekyilmaz <hakan@askmonty.org> branch nick: mariadb-tools timestamp: Wed 2010-03-03 20:46:11 +0100 message: Detabbed. === modified file 'sysbench/run-sysbench-myisam.sh' --- a/sysbench/run-sysbench-myisam.sh 2010-03-03 19:29:49 +0000 +++ b/sysbench/run-sysbench-myisam.sh 2010-03-03 19:46:11 +0000 @@ -116,10 +116,10 @@ WORK_DIR='/tmp' if [ ! -d $LOCAL_MASTER ]; then - echo "[ERROR]: Supplied local master $LOCAL_MASTER does not exists." - echo " Please provide a valid bzr repository." - echo " Exiting." - exit 1 + echo "[ERROR]: Supplied local master $LOCAL_MASTER does not exists." + echo " Please provide a valid bzr repository." + echo " Exiting." + exit 1 fi # @@ -144,10 +144,10 @@ cd $WORK_DIR TEMP_DIR=$(mktemp -d) if [ $? != 0 ]; then - echo "[ERROR]: mktemp in $WORK_DIR failed." - echo 'Exiting.' + echo "[ERROR]: mktemp in $WORK_DIR failed." + echo 'Exiting.' - exit 1 + exit 1 fi # @@ -157,10 +157,10 @@ echo "Exporting from $LOCAL_MASTER to ${TEMP_DIR}/build" $BZR export --format=dir ${TEMP_DIR}/build $LOCAL_MASTER if [ $? != 0 ]; then - echo '[ERROR]: bzr export failed.' - echo 'Exiting.' + echo '[ERROR]: bzr export failed.' + echo 'Exiting.' - exit 1 + exit 1 fi # @@ -172,10 +172,10 @@ cd ${TEMP_DIR}/build BUILD/compile-amd64-max > $BUILD_LOG 2>&1 if [ $? != 0 ]; then - echo "[ERROR]: Build of $PRODUCT failed" - echo " Please check your log at $BUILD_LOG" - echo " Exiting." - exit 1 + echo "[ERROR]: Build of $PRODUCT failed" + echo " Please check your log at $BUILD_LOG" + echo " Exiting." + exit 1 fi echo "[$(date "+%Y-%m-%d %H:%M:%S")] Finnished compiling $PRODUCT." @@ -209,62 +209,62 @@ j=0 STARTED=-1 while [ $j -le $TIMEOUT ] - do - $MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1 - if [ $? = 0 ]; then - STARTED=0 - - break - fi - - sleep 1 - j=$(($j + 1)) + do + $MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1 + if [ $? = 0 ]; then + STARTED=0 + + break + fi + + sleep 1 + j=$(($j + 1)) done if [ $STARTED != 0 ]; then - echo '[ERROR]: Start of mysqld failed.' - echo ' Please check your error log.' - echo ' Exiting.' + echo '[ERROR]: Start of mysqld failed.' + echo ' Please check your error log.' + echo ' Exiting.' - exit 1 + exit 1 fi for SYSBENCH_TEST in $SYSBENCH_TESTS - do - mkdir ${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST} - - for THREADS in $NUM_THREADS - do - THIS_RESULT_DIR="${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST}/${THREADS}" - mkdir $THIS_RESULT_DIR - echo "[$(date "+%Y-%m-%d %H:%M:%S")] Running $SYSBENCH_TEST with $THREADS threads and $LOOP_COUNT iterations for $PRODUCT" | tee ${THIS_RESULT_DIR}/results.txt - echo '' >> ${THIS_RESULT_DIR}/results.txt - - k=0 - while [ $k -lt $LOOP_COUNT ] - do - $MYSQLADMIN $MYSQLADMIN_OPTIONS -f drop sbtest - $MYSQLADMIN $MYSQLADMIN_OPTIONS create sbtest - if [ $? != 0 ]; then - echo "[ERROR]: Create of sbtest database failed" - echo " Please check your setup." - echo " Exiting" - exit 1 - fi - - SYSBENCH_OPTIONS="$SYSBENCH_OPTIONS --num-threads=$THREADS --test=${TEST_DIR}/${SYSBENCH_TEST}" - $SYSBENCH $SYSBENCH_OPTIONS prepare - - sync - sleep 3 - - $SYSBENCH $SYSBENCH_OPTIONS run > ${THIS_RESULT_DIR}/result${k}.txt 2>&1 - - grep "write requests:" ${THIS_RESULT_DIR}/result${k}.txt | awk '{ print $4 }' | sed -e 's/(//' >> ${THIS_RESULT_DIR}/results.txt - - k=$(($k + 1)) - done - done + do + mkdir ${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST} + + for THREADS in $NUM_THREADS + do + THIS_RESULT_DIR="${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST}/${THREADS}" + mkdir $THIS_RESULT_DIR + echo "[$(date "+%Y-%m-%d %H:%M:%S")] Running $SYSBENCH_TEST with $THREADS threads and $LOOP_COUNT iterations for $PRODUCT" | tee ${THIS_RESULT_DIR}/results.txt + echo '' >> ${THIS_RESULT_DIR}/results.txt + + k=0 + while [ $k -lt $LOOP_COUNT ] + do + $MYSQLADMIN $MYSQLADMIN_OPTIONS -f drop sbtest + $MYSQLADMIN $MYSQLADMIN_OPTIONS create sbtest + if [ $? != 0 ]; then + echo "[ERROR]: Create of sbtest database failed" + echo " Please check your setup." + echo " Exiting" + exit 1 + fi + + SYSBENCH_OPTIONS="$SYSBENCH_OPTIONS --num-threads=$THREADS --test=${TEST_DIR}/${SYSBENCH_TEST}" + $SYSBENCH $SYSBENCH_OPTIONS prepare + + sync + sleep 3 + + $SYSBENCH $SYSBENCH_OPTIONS run > ${THIS_RESULT_DIR}/result${k}.txt 2>&1 + + grep "write requests:" ${THIS_RESULT_DIR}/result${k}.txt | awk '{ print $4 }' | sed -e 's/(//' >> ${THIS_RESULT_DIR}/results.txt + + k=$(($k + 1)) + done + done done # === modified file 'sysbench/run-sysbench.sh' --- a/sysbench/run-sysbench.sh 2010-03-03 19:29:49 +0000 +++ b/sysbench/run-sysbench.sh 2010-03-03 19:46:11 +0000 @@ -126,10 +126,10 @@ WORK_DIR='/tmp' if [ ! -d $LOCAL_MASTER ]; then - echo "[ERROR]: Supplied local master $LOCAL_MASTER does not exists." - echo " Please provide a valid bzr repository." - echo " Exiting." - exit 1 + echo "[ERROR]: Supplied local master $LOCAL_MASTER does not exists." + echo " Please provide a valid bzr repository." + echo " Exiting." + exit 1 fi # @@ -154,10 +154,10 @@ cd $WORK_DIR TEMP_DIR=$(mktemp -d) if [ $? != 0 ]; then - echo "[ERROR]: mktemp in $WORK_DIR failed." - echo 'Exiting.' + echo "[ERROR]: mktemp in $WORK_DIR failed." + echo 'Exiting.' - exit 1 + exit 1 fi # @@ -167,10 +167,10 @@ echo "Exporting from $LOCAL_MASTER to ${TEMP_DIR}/build" $BZR export --format=dir ${TEMP_DIR}/build $LOCAL_MASTER if [ $? != 0 ]; then - echo '[ERROR]: bzr export failed.' - echo 'Exiting.' + echo '[ERROR]: bzr export failed.' + echo 'Exiting.' - exit 1 + exit 1 fi # @@ -182,10 +182,10 @@ cd ${TEMP_DIR}/build BUILD/compile-amd64-max > $BUILD_LOG 2>&1 if [ $? != 0 ]; then - echo "[ERROR]: Build of $PRODUCT failed" - echo " Please check your log at $BUILD_LOG" - echo " Exiting." - exit 1 + echo "[ERROR]: Build of $PRODUCT failed" + echo " Please check your log at $BUILD_LOG" + echo " Exiting." + exit 1 fi echo "[$(date "+%Y-%m-%d %H:%M:%S")] Finnished compiling $PRODUCT." @@ -219,58 +219,62 @@ j=0 STARTED=-1 while [ $j -le $TIMEOUT ] - do - $MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1 - if [ $? = 0 ]; then - STARTED=0 - - break - fi - - sleep 1 - j=$(($j + 1)) + do + $MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1 + if [ $? = 0 ]; then + STARTED=0 + + break + fi + + sleep 1 + j=$(($j + 1)) done if [ $STARTED != 0 ]; then - echo '[ERROR]: Start of mysqld failed.' - echo ' Please check your error log.' - echo ' Exiting.' + echo '[ERROR]: Start of mysqld failed.' + echo ' Please check your error log.' + echo ' Exiting.' - exit 1 + exit 1 fi for SYSBENCH_TEST in $SYSBENCH_TESTS - do - mkdir ${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST} - - for THREADS in $NUM_THREADS - do - THIS_RESULT_DIR="${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST}/${THREADS}" - mkdir $THIS_RESULT_DIR - echo "[$(date "+%Y-%m-%d %H:%M:%S")] Running $SYSBENCH_TEST with $THREADS threads and $LOOP_COUNT iterations for $PRODUCT" | tee ${THIS_RESULT_DIR}/results.txt - echo '' >> ${THIS_RESULT_DIR}/results.txt - - k=0 - while [ $k -lt $LOOP_COUNT ] - do - $MYSQLADMIN $MYSQLADMIN_OPTIONS -f drop sbtest - $MYSQLADMIN $MYSQLADMIN_OPTIONS create sbtest - if [ $? != 0 ]; then - echo "[ERROR]: Create of sbtest database failed" - echo " Please check your setup." - echo " Exiting" - exit 1 - fi - - SYSBENCH_OPTIONS="$SYSBENCH_OPTIONS --num-threads=$THREADS --test=${TEST_DIR}/${SYSBENCH_TEST}" - $SYSBENCH $SYSBENCH_OPTIONS prepare - $SYSBENCH $SYSBENCH_OPTIONS run > ${THIS_RESULT_DIR}/result${k}.txt 2>&1 - - grep "write requests:" ${THIS_RESULT_DIR}/result${k}.txt | awk '{ print $4 }' | sed -e 's/(//' >> ${THIS_RESULT_DIR}/results.txt - - k=$(($k + 1)) - done - done + do + mkdir ${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST} + + for THREADS in $NUM_THREADS + do + THIS_RESULT_DIR="${RESULT_DIR}/${TODAY}/${PRODUCT}/${SYSBENCH_TEST}/${THREADS}" + mkdir $THIS_RESULT_DIR + echo "[$(date "+%Y-%m-%d %H:%M:%S")] Running $SYSBENCH_TEST with $THREADS threads and $LOOP_COUNT iterations for $PRODUCT" | tee ${THIS_RESULT_DIR}/results.txt + echo '' >> ${THIS_RESULT_DIR}/results.txt + + k=0 + while [ $k -lt $LOOP_COUNT ] + do + $MYSQLADMIN $MYSQLADMIN_OPTIONS -f drop sbtest + $MYSQLADMIN $MYSQLADMIN_OPTIONS create sbtest + if [ $? != 0 ]; then + echo "[ERROR]: Create of sbtest database failed" + echo " Please check your setup." + echo " Exiting" + exit 1 + fi + + SYSBENCH_OPTIONS="$SYSBENCH_OPTIONS --num-threads=$THREADS --test=${TEST_DIR}/${SYSBENCH_TEST}" + $SYSBENCH $SYSBENCH_OPTIONS prepare + + sync + sleep 3 + + $SYSBENCH $SYSBENCH_OPTIONS run > ${THIS_RESULT_DIR}/result${k}.txt 2>&1 + + grep "write requests:" ${THIS_RESULT_DIR}/result${k}.txt | awk '{ print $4 }' | sed -e 's/(//' >> ${THIS_RESULT_DIR}/results.txt + + k=$(($k + 1)) + done + done done #