Scripts update to run rubbos on compass4nfv env
[bottlenecks.git] / rubbos / rubbos_scripts / 1-1-1 / scripts / CONTROL_rubbos_exec.sh
index 3fa3047..565a5b7 100755 (executable)
@@ -17,21 +17,34 @@ ssh $BENCHMARK_HOST "
   mkdir -p $TMP_RESULTS_DIR_BASE/$RUBBOS_RESULTS_DIR_NAME
 "
 
-#TODO use for loop to genrate rubbos.properties file 200 ~ 1700
-for i in "rubbos.properties_200"
+# run test rubbos.properties from 200 to 3200
+for i in {2..7..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
 
-  #echo "Resetting all data"
-  #$OUTPUT_HOME/scripts/reset_all.sh
+  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/*"
@@ -53,6 +66,7 @@ do
   #" &
 
   ssh $BENCHMARK_HOST "
+    set -x
     source /bottlenecks/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
 
     cd $RUBBOS_HOME/bench
@@ -68,41 +82,62 @@ do
     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-*
+      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/
   "
 
-  # TODO debug the rest of sciripts
-  exit 0
-  #$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