3 # author__ = "Jan Medved"
4 # copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
5 # license__ = "New-style BSD"
6 # email__ = "jmedved@cisco.com"
8 CMD="./flow_config_blaster.py"
12 echo "usage: $programname [-h?an] [-i instances] [-c cycles] [-f flows] [- threads]"
13 echo " -h|? print this message"
14 echo " -a use default authentication ('admin/admin')"
15 echo " -n use the 'no-delete' flag in '$CMD'"
16 echo " -i instances number of '$CMD' instances to spawn"
17 echo " -c cycles number of cycles in '$CMD'"
18 echo " -f flows number of flows in '$CMD'"
19 echo " -t threads number of threads in '$CMD'"
22 # Initialize our own variables:
31 while getopts "h?ac:f:i:nt:" opt; do
52 echo "Running $instances instance(s), parameters:\n flows='flows', threads=$threads, cycles=$cycles, \
53 no-delete='$no_delete', auth='$auth'"
56 let "flows_per_instance=$cycles * $flows * $threads"
58 printf "FPI: %d\n" $flows_per_instance
62 while [ $i -lt $instances ]; do
63 let "startflow=$flows_per_instance * $i"
65 CMD_STRING=$(printf '%s --cycles %s --flows %s --threads %s --startflow %s' $CMD $cycles $flows $threads $startflow)
66 if [ "$auth" = true ] ; then
69 if [ "$no_delete" = true ] ; then
70 CMD_STRING+=' --no-delete'
73 echo "Starting instance $i: '$CMD_STRING'"
79 ELAPSED_TIME=$(($SECONDS - $START_TIME))
81 let "rate=($flows_per_instance * $instances)/$ELAPSED_TIME"
83 echo "Measured rate: $rate"
84 echo "Measured time: $ELAPSED_TIME"