2 ##############################################################################
3 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 cd /bottlenecks/rubbos/rubbos_scripts/1-1-1
14 source set_bottlenecks_rubbos_env.sh
15 export scp_options='-o StrictHostKeyChecking=no -o BatchMode=yes'
17 scp $WORK_HOME/monitors_files/oprofile_start.sh $MYSQL1_HOST:/tmp/
19 echo "Starting RUBBoS"
21 ssh $RUBBOS_RESULTS_HOST "
22 mkdir -p $RUBBOS_RESULTS_DIR_BASE
25 mkdir -p $TMP_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME
28 # run test rubbos.properties from 200 to 3200
31 echo "Start Browsing Only with rubbos.properties_$((100*i)) $(date)"
34 source /bottlenecks/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
35 rm -f $RUBBOS_HOME/Client/rubbos.properties
38 sed -e "s/REPLACE_HTTPD_HOST/$HTTPD_HOST/g" \
39 -e "s/REPLACE_TOMCAT1_HOST/$TOMCAT1_HOST/g" \
40 -e "s/REPLACE_MYSQL1_HOST/$MYSQL1_HOST/g" \
41 -e "s#REPLACE_CLIENT1_HOST#$CLIENT1_HOST#g" \
42 -e "s#REPLACE_CLIENT2_HOST#$CLIENT2_HOST#g" \
43 -e "s#REPLACE_CLIENT3_HOST#$CLIENT3_HOST#g" \
44 -e "s#REPLACE_CLIENT4_HOST#$CLIENT4_HOST#g" \
45 -e "s/REPLACE_NUMBER_OF_CLIENTS_PER_NODE/$((20*i))/g" \
46 $OUTPUT_HOME/rubbos_conf/rubbos.properties_template \
47 > $OUTPUT_HOME/rubbos_conf/rubbos.properties
48 scp $OUTPUT_HOME/rubbos_conf/rubbos.properties $BENCHMARK_HOST:$RUBBOS_HOME/Client/rubbos.properties
49 rm -rf $OUTPUT_HOME/rubbos_conf/rubbos.properties
51 echo "Resetting all data"
52 $OUTPUT_HOME/scripts/reset_all.sh
55 echo "Start Browsing Only with rubbos.properties_$((100*i))"
56 echo "Removing previous logs..."
57 ssh $HTTPD_HOST "rm -f $HTTPD_HOME/logs/*log"
58 ssh $TOMCAT1_HOST "rm -f $CATALINA_HOME/logs/*"
59 ssh $MYSQL1_HOST "rm -f $MYSQL_HOME/run/*.log $RUBBOS_APP/mysql_mon-*"
61 $OUTPUT_HOME/scripts/start_all.sh
64 for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
65 $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
67 ssh $host "rm -f $RUBBOS_APP/sar-* $RUBBOS_APP/ps-* $RUBBOS_APP/iostat-*"
69 ssh $MYSQL1_HOST "rm -f /tmp/*.log"
70 ssh $MYSQL1_HOST chmod 777 /tmp/oprofile_start.sh
78 source /bottlenecks/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
84 echo "execute benchmark"
85 ./rubbos-servletsBO.sh
88 echo "The benchmark has finished. Now, collecting results..."
90 for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
91 $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
93 for f in 'sar-*' 'ps-*' 'iostat-*' 'mysql_mon-*' 'postgres_lock-*'
95 scp $scp_options \$host:$RUBBOS_APP/\$f ./
100 find -type f | grep stat_client | xargs grep throughput
101 mv 20* $TMP_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME/
104 $OUTPUT_HOME/scripts/stop_all.sh
105 $OUTPUT_HOME/scripts/kill_all.sh
108 echo "End Browsing Only with rubbos.properties_$((100*i)) $(date)"
111 echo "Processing the results..."
112 ssh $BENCHMARK_HOST "
113 cd $TMP_RESULTS_DIR_BASE
114 #cd $RUBBOS_RESULTS_DIR_NAME
115 #scp $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/calc-sarSummary.prl ../
116 #../calc-sarSummary.prl
121 tar zcf $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_DIR_NAME
122 scp $scp_options $RUBBOS_RESULTS_DIR_NAME.tgz $RUBBOS_RESULTS_HOST:$RUBBOS_RESULTS_DIR_BASE/
125 echo "Push the results to DB..."
126 cd $RUBBOS_RESULTS_DIR_BASE
128 ls $RUBBOS_RESULTS_DIR_NAME.tgz
129 tar zxf $RUBBOS_RESULTS_DIR_NAME.tgz
130 ls $RUBBOS_RESULTS_DIR_NAME
132 echo "Fetch POD env parameters"
133 source /tmp/vm_dev_setup/hosts.conf
134 sed -i -e "s/REPLACE_NODE_NAME/$NODE_NAME/g" \
135 -e "s/REPLACE_INSTALLER_TYPE/$INSTALLER_TYPE/g" \
136 -e "s/REPLACE_VERSION/$BOTTLENECKS_VERSION/g" \
137 -e "s#REPLACE_BOTTLENECKS_DB_TARGET#$BOTTLENECKS_DB_TARGET#g" \
138 $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
140 cat $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
142 python $BOTTLENECKS_TOP/utils/dashboard/process_data.py \
143 $RUBBOS_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME \
144 $BOTTLENECKS_TOP/utils/dashboard/dashboard.yaml
148 touch /tmp/rubbos_finished