#!/bin/bash
+##############################################################################
+# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+set -x
cd /bottlenecks/rubbos/rubbos_scripts/1-1-1
source set_bottlenecks_rubbos_env.sh
+export scp_options='-o StrictHostKeyChecking=no -o BatchMode=yes'
scp $WORK_HOME/monitors_files/oprofile_start.sh $MYSQL1_HOST:/tmp/
mkdir -p $TMP_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME
"
-#for i in "rubbos.properties_200" "rubbos.properties_300" "rubbos.properties_400" "rubbos.properties_500" "rubbos.properties_600" "rubbos.properties_700" "rubbos.properties_800" "rubbos.properties_900" "rubbos.properties_1000" "rubbos.properties_1100" "rubbos.properties_1200" "rubbos.properties_1300" "rubbos.properties_1400" "rubbos.properties_1500" "rubbos.properties_1600" "rubbos.properties_1700"
-for i in "rubbos.properties_200"
+# run test rubbos.properties from 200 to 3200
+for i in {2..32..5}
do
+ echo "Start Browsing Only with rubbos.properties_$((100*i)) $(date)"
ssh $BENCHMARK_HOST "
source /bottlenecks/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
rm -f $RUBBOS_HOME/Client/rubbos.properties
"
- scp $OUTPUT_HOME/rubbos_conf/$i $BENCHMARK_HOST:$RUBBOS_HOME/Client/rubbos.properties
+
+ sed -e "s/REPLACE_HTTPD_HOST/$HTTPD_HOST/g" \
+ -e "s/REPLACE_TOMCAT1_HOST/$TOMCAT1_HOST/g" \
+ -e "s/REPLACE_MYSQL1_HOST/$MYSQL1_HOST/g" \
+ -e "s#REPLACE_CLIENT1_HOST#$CLIENT1_HOST#g" \
+ -e "s#REPLACE_CLIENT2_HOST#$CLIENT2_HOST#g" \
+ -e "s#REPLACE_CLIENT3_HOST#$CLIENT3_HOST#g" \
+ -e "s#REPLACE_CLIENT4_HOST#$CLIENT4_HOST#g" \
+ -e "s/REPLACE_NUMBER_OF_CLIENTS_PER_NODE/$((20*i))/g" \
+ $OUTPUT_HOME/rubbos_conf/rubbos.properties_template \
+ > $OUTPUT_HOME/rubbos_conf/rubbos.properties
+ scp $OUTPUT_HOME/rubbos_conf/rubbos.properties $BENCHMARK_HOST:$RUBBOS_HOME/Client/rubbos.properties
+ rm -rf $OUTPUT_HOME/rubbos_conf/rubbos.properties
echo "Resetting all data"
$OUTPUT_HOME/scripts/reset_all.sh
# Browsing Only
- echo "Start Browsing Only with $i"
+ echo "Start Browsing Only with rubbos.properties_$((100*i))"
echo "Removing previous logs..."
ssh $HTTPD_HOST "rm -f $HTTPD_HOME/logs/*log"
ssh $TOMCAT1_HOST "rm -f $CATALINA_HOME/logs/*"
$OUTPUT_HOME/scripts/start_all.sh
sleep 15
- ssh $BENCHMARK_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $CLIENT1_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $CLIENT2_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $CLIENT3_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $CLIENT4_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $HTTPD_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $TOMCAT1_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $MYSQL1_HOST "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
- ssh $MYSQL1_HOST "sudo rm -f /tmp/*.log"
- ssh root@$MYSQL1_HOST chmod 777 /tmp/oprofile_start.sh
- ssh $MYSQL1_HOST "
- cd /tmp
- ./oprofile_start.sh
- " &
+ for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
+ $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
+ do
+ ssh $host "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
+ done
+ ssh $MYSQL1_HOST "rm -f /tmp/*.log"
+ ssh $MYSQL1_HOST chmod 777 /tmp/oprofile_start.sh
+ #ssh $MYSQL1_HOST "
+ # cd /tmp
+ # ./oprofile_start.sh
+ #" &
ssh $BENCHMARK_HOST "
+ set -x
source /bottlenecks/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
+
cd $RUBBOS_HOME/bench
\rm -r 20*
# Collect results
echo "The benchmark has finished. Now, collecting results..."
cd 20*
- scp $BENCHMARK_HOST:$RUBBOS_APP/sar-* ./
- scp $BENCHMARK_HOST:$RUBBOS_APP/ps-* ./
- scp $BENCHMARK_HOST:$RUBBOS_APP/iostat-* ./
- scp $BENCHMARK_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $BENCHMARK_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $CLIENT1_HOST:$RUBBOS_APP/sar-* ./
- scp $CLIENT1_HOST:$RUBBOS_APP/ps-* ./
- scp $CLIENT1_HOST:$RUBBOS_APP/iostat-* ./
- scp $CLIENT1_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $CLIENT1_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $CLIENT2_HOST:$RUBBOS_APP/sar-* ./
- scp $CLIENT2_HOST:$RUBBOS_APP/ps-* ./
- scp $CLIENT2_HOST:$RUBBOS_APP/iostat-* ./
- scp $CLIENT2_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $CLIENT2_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $CLIENT3_HOST:$RUBBOS_APP/sar-* ./
- scp $CLIENT3_HOST:$RUBBOS_APP/ps-* ./
- scp $CLIENT3_HOST:$RUBBOS_APP/iostat-* ./
- scp $CLIENT3_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $CLIENT3_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $CLIENT4_HOST:$RUBBOS_APP/sar-* ./
- scp $CLIENT4_HOST:$RUBBOS_APP/ps-* ./
- scp $CLIENT4_HOST:$RUBBOS_APP/iostat-* ./
- scp $CLIENT4_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $CLIENT4_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $HTTPD_HOST:$RUBBOS_APP/sar-* ./
- scp $HTTPD_HOST:$RUBBOS_APP/ps-* ./
- scp $HTTPD_HOST:$RUBBOS_APP/iostat-* ./
- scp $HTTPD_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $HTTPD_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $TOMCAT1_HOST:$RUBBOS_APP/sar-* ./
- scp $TOMCAT1_HOST:$RUBBOS_APP/ps-* ./
- scp $TOMCAT1_HOST:$RUBBOS_APP/iostat-* ./
- scp $TOMCAT1_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $TOMCAT1_HOST:$RUBBOS_APP/postgres_lock-* ./
- scp $MYSQL1_HOST:$RUBBOS_APP/sar-* ./
- scp $MYSQL1_HOST:$RUBBOS_APP/ps-* ./
- scp $MYSQL1_HOST:$RUBBOS_APP/iostat-* ./
- scp $MYSQL1_HOST:$RUBBOS_APP/mysql_mon-* ./
- scp $MYSQL1_HOST:$RUBBOS_APP/postgres_lock-* ./
+ for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
+ $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
+ do
+ for f in 'sar-*' 'ps-*' 'iostat-*' 'mysql_mon-*' 'postgres_lock-*'
+ do
+ scp $scp_options \$host:$RUBBOS_APP/\$f ./
+ done
+ done
cd ..
+ find -type f
+ find -type f | grep stat_client | xargs grep throughput
mv 20* $TMP_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME/
"
- #$OUTPUT_HOME/scripts/stop_all.sh
+ $OUTPUT_HOME/scripts/stop_all.sh
$OUTPUT_HOME/scripts/kill_all.sh
sleep 15
- echo "End Browsing Only with $i"
-
- # Read/Write
+ echo "End Browsing Only with rubbos.properties_$((100*i)) $(date)"
done
echo "Processing the results..."
ssh $BENCHMARK_HOST "
cd $TMP_RESULTS_DIR_BASE
- cd $RUBBOS_RESULTS_DIR_NAME
- scp $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/calc-sarSummary.prl ../
- ../calc-sarSummary.prl
+ #cd $RUBBOS_RESULTS_DIR_NAME
+ #scp $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/calc-sarSummary.prl ../
+ #../calc-sarSummary.prl
- rm -f 20*/*.bin
+ #rm -f 20*/*.bin
- cd ../
- tar zcvf $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_DIR_NAME
- scp $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/
+ #cd ../
+ tar zcf $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_DIR_NAME
+ scp $scp_options $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/
"
+echo "Push the results to DB..."
+cd $RUBBOS_RESULTS_DIR_BASE
+
+ls $RUBBOS_RESULTS_DIR_NAME.tgz
+tar zxf $RUBBOS_RESULTS_DIR_NAME.tgz
+ls $RUBBOS_RESULTS_DIR_NAME
+
+echo "Fetch POD env parameters"
+source /tmp/vm_dev_setup/hosts.conf
+sed -i -e "s/REPLACE_NODE_NAME/$NODE_NAME/g" \
+ -e "s/REPLACE_INSTALLER_TYPE/$INSTALLER_TYPE/g" \
+ -e "s/REPLACE_VERSION/$BOTTLENECKS_VERSION/g" \
+ -e "s#REPLACE_BOTTLENECKS_DB_TARGET#$BOTTLENECKS_DB_TARGET#g" \
+ $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
+
+cat $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
+
+python $BOTTLENECKS_TOP/utils/dashboard/process_data.py \
+ $RUBBOS_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME \
+ $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
+cd -
+
echo "Finish RUBBoS"
+touch /tmp/rubbos_finished
+
+set +x
+