From: Jan Medved Date: Sun, 30 Nov 2014 03:54:35 +0000 (-0800) Subject: Replaced the multi-blaster skeleton with real functionality. multi-blaster functions... X-Git-Tag: release/helium-sr1.1~6^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=3acb938eec3a00c917e68ca7d505ef3e59481139;hp=6783c66a31fdc24a3824205034b72556fc528f9d;p=integration%2Ftest.git Replaced the multi-blaster skeleton with real functionality. multi-blaster functions are now driven from command line switches and arguments. Change-Id: I2209a8bf86f3c26930a4f5a126356917ae0548e7 Signed-off-by: Jan Medved --- diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/multi-blaster.sh b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/multi-blaster.sh index f4296a1c93..0b8dc1b586 100755 --- a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/multi-blaster.sh +++ b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/multi-blaster.sh @@ -1,18 +1,86 @@ -#!/usr/bin/env bash +#!/bin/bash -echo "Starting Blaster 1:" -./flow_config_blaster.py --flows=1000 --threads=5 --auth --no-delete & +# author__ = "Jan Medved" +# copyright__ = "Copyright(c) 2014, Cisco Systems, Inc." +# license__ = "New-style BSD" +# email__ = "jmedved@cisco.com" -echo "Starting Blaster 2:" -./flow_config_blaster.py --flows=1000 --threads=5 --auth --no-delete --startflow=5000 & +CMD="./flow_config_blaster.py" +programname=$0 -echo "Starting Blaster 3:" -./flow_config_blaster.py --flows=1000 --threads=5 --auth --no-delete --startflow=10000 & +function usage { + echo "usage: $programname [-h?an] [-i instances] [-c cycles] [-f flows] [- threads]" + echo " -h|? print this message" + echo " -a use default authentication ('admin/admin')" + echo " -n use the 'no-delete' flag in '$CMD'" + echo " -i instances number of '$CMD' instances to spawn" + echo " -c cycles number of cycles in '$CMD'" + echo " -f flows number of flows in '$CMD'" + echo " -t threads number of threads in '$CMD'" +} -echo "Starting Blaster 4:" -./flow_config_blaster.py --flows=1000 --threads=5 --auth --no-delete --startflow=15000 & +# Initialize our own variables: -echo "Starting Blaster 5:" -./flow_config_blaster.py --flows=1000 --threads=5 --auth --no-delete --startflow=20000 & +instances=1 +no_delete=false +auth=false +threads=1 +flows=1000 +cycles=1 +while getopts "h?ac:f:i:nt:" opt; do + case "$opt" in + h|\?) + usage + exit 1 + ;; + a) auth=true + ;; + c) cycles=$OPTARG + ;; + f) flows=$OPTARG + ;; + i) instances=$OPTARG + ;; + n) no_delete=true + ;; + t) threads=$OPTARG + ;; + esac +done + +echo "Running $instances instance(s), parameters:\n flows='flows', threads=$threads, cycles=$cycles, \ +no-delete='$no_delete', auth='$auth'" + + +let "flows_per_instance=$cycles * $flows * $threads" + +printf "FPI: %d\n" $flows_per_instance + +i=0 +START_TIME=$SECONDS +while [ $i -lt $instances ]; do + let "startflow=$flows_per_instance * $i" + + CMD_STRING=$(printf '%s --cycles %s --flows %s --threads %s --startflow %s' $CMD $cycles $flows $threads $startflow) + if [ "$auth" = true ] ; then + CMD_STRING+=' --auth' + fi + if [ "$no_delete" = true ] ; then + CMD_STRING+=' --no-delete' + fi + + echo "Starting instance $i: '$CMD_STRING'" + let i=$i+1 + $CMD_STRING & +done + +wait +ELAPSED_TIME=$(($SECONDS - $START_TIME)) + +let "rate=($flows_per_instance * $instances)/$ELAPSED_TIME" echo "Done." +echo "Measured rate: $rate" +echo "Measured time: $ELAPSED_TIME" + +# End of file