Sometimes there is the need to run the same loadtest simulating different load levels (virtual users) or you'd simply run the test at regular intervals or at odd times.
Should that be the case you can create a script that can invoke Proxy Sniffer and run the required load tests for. Below you'll find an example of a bash script that can be used on any Unix derivative, including OS X.
#!/bin/bash
##############################################
#
#
# Sample Proxy Sniffer script showing how a test can be run
# at different virtual users levels without manual intervention
# on a PS cluster.
# Copy this script in the PS home foldwr (where prxsniff.jar is located)
# and then adapt the various parameters below (... see comments)
###############################################
CLASSPATH=prxsniff.jar
JAVA='/usr/bin/java'
export CLASSPATH
# Path to the test class or zip file you want to have executed
TESTNAME=MyTests/aa_auth.zip
# The prefix to be used for the results filenames (.prxres files)
PREFIX=aa_auth_23Apr_001_
# Cluster to run the test on
CLUSTER=Test
# URL request timeout, in seconds
TIMEOUT=60
#How long each test run will last, in seconds
DURATION=300
#Startup-delay for each virtual user, in milliseconds
SDELAY=100
#Maximum number of loops for each virtual user
MAXLOOPS=0
#Optional: Other test-specific parameters (required by plugins, etc...)
PARGS="-aaport 8080 -aaip 10.32.27.115"
#Specify on the next line the number of virtual users that each
#test execution should run at
for i in 10 20 40 80 100 150 200
do
echo Executing test with $i users...
$JAVA java -Xbootclasspath/p:./prxsniff.jar PrxJob transmitClusterJob $CLUSTER $TESTNAME -u $i -d $DURATION -t $TIMEOUT -sdelay $SDELAY -maxloops $MAXLOOPS $PARGS
JOBID=$?
echo Running cluster job $JOBID
sleep 5
java -Xbootclasspath/p:./prxsniff.jar PrxJob startClusterJob $CLUSTER $JOBID
# echo $?
java -Xbootclasspath/p:./prxsniff.jar PrxJob waitForClusterJobCompletion $CLUSTER $JOBID
# echo $?
echo Collecting results...
java -Xbootclasspath/p:./prxsniff.jar PrxJob acquireClusterJobResultFile $CLUSTER $JOBID $PREFIX$i.prxres
done