3 # author__ = "Jan Medved"
4 # copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
5 # license__ = "New-style BSD"
6 # email__ = "jmedved@cisco.com"
9 CMD="./shard_perf_test.py"
11 # Default number od $CMD instances to start
14 # Default parameters for $CMD
23 echo "usage: $programname [-h?an] [-i instances] [-c cycles] [-f flows] [-t threads] [-o odl_host] [-p odl_port]"
24 echo " -h|? print this message"
25 echo " -a use default authentication ('admin/admin')"
26 echo " -n use the 'no-delete' flag in '$CMD'"
27 echo " -i instances number of '$CMD' instances to spawn"
28 echo " -c cycles number of cycles"
29 echo " -f flows number of flows"
30 echo " -o odl_host IP Address of the ODL controller"
31 echo " -p odl_port RESTCONF port in the ODL controller"
32 echo " -t threads number of threads"
33 echo "Optional flags/arguments [acfnopt] are passed to '$CMD'."
37 while getopts "h?ai:n:o:p:r:t:" opt; do
61 echo "*** Creating $instances instance(s) of '$CMD' ***"
66 while [ $i -lt $instances ]; do
67 CMD_STRING=$(printf '%s --resource %s --requests %s --threads %s' $CMD $resource $requests $threads)
68 CMD_STRING+=$(printf ' --host %s --port %s' $odl_host $odl_port)
69 if [ "$auth" = true ] ; then
72 echo "Starting instance $i: '$CMD_STRING'"
79 ELAPSED_TIME=$(($SECONDS - $START_TIME))
83 if [ "$ELAPSED_TIME" -gt 0 ] ; then
84 let "rate=(threads * $requests * $instances)/$ELAPSED_TIME"
85 echo "Measured rate: $rate"
86 echo "Measured time: $ELAPSED_TIME"