FairMQ/fairmq/run/startMQBenchmark.sh.in
2016-05-27 12:58:07 +02:00

44 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
numMsgs="0"
msgSize="1000000"
if [[ $1 =~ ^[0-9]+$ ]]; then
msgSize=$1
fi
echo "Starting benchmark with message size of $msgSize bytes."
if [[ $2 =~ ^[0-9]+$ ]]; then
numMsgs=$2
fi
if [ $numMsgs = 0 ]; then
echo "Unlimited number of messages."
else
echo "Number of messages: $numMsgs."
fi
echo ""
echo "Usage: startBenchmark [message size=1000000] [number of messages=0]"
SAMPLER="bsampler"
SAMPLER+=" --id bsampler1"
#SAMPLER+=" --io-threads 2"
#SAMPLER+=" --control static"
#SAMPLER+=" --transport nanomsg"
SAMPLER+=" --msg-size $msgSize"
# SAMPLER+=" --msg-rate 1000"
SAMPLER+=" --num-msgs $numMsgs"
SAMPLER+=" --mq-config @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
SINK="sink"
SINK+=" --id sink1"
#SINK+=" --io-threads 2"
#SINK+=" --control static"
#SINK+=" --transport nanomsg"
SINK+=" --num-msgs $numMsgs"
SINK+=" --mq-config @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &