Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Wait for workers before starting master #32

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docker/jmeter-master/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@

run_jmeter_test() {
FILE=$1
[[ "$USE_WORKERS" == "true" ]] && WORKER_OPTS="-R $(getent ahostsv4 "$WORKER_SVC_NAME" | cut -d ' ' -f 1 | sort -u | paste --serial --delimiters ',')"
if [[ "$USE_WORKERS" == "true" ]]; then
WORKER_HOSTS=$(getent ahostsv4 "$WORKER_SVC_NAME")
if [[ $(echo "$WORKER_HOSTS" | cut -d ' ' -f 1 | sort -u | wc -l) == $WORKERS_TOTAL ]]; then
echo "=== Waiting for workers ==="
while [[ "$WORKER_HOSTS" == "" ]]; do
sleep 10
WORKER_HOSTS=$(getent ahostsv4 "$WORKER_SVC_NAME")
done
fi
WORKER_OPTS="-R $(echo "$WORKER_HOSTS" | cut -d ' ' -f 1 | sort -u | paste --serial --delimiters ',')"
fi
echo "=== Running JMeter load generator ==="

"$JMETER_HOME"/bin/jmeter.sh -n -t "$FILE" -l results.csv -e -o /results/ -Jserver.rmi.ssl.disable="$SSL_DISABLED" "$WORKER_OPTS" >>output.log 2>&1 &
"$JMETER_HOME"/bin/jmeter.sh -n -t "$FILE" -l results.csv -e -o /results/ -Jserver.rmi.ssl.disable="$SSL_DISABLED" "$WORKER_OPTS" 2>&1 | tee -a output.log &

echo "Checking output.log"
while true; do
echo "=== Waiting JMeter to finish ==="
cat output.log
if grep "end of run" ./output.log; then
echo "=== Jmeter is finished! ==="
cp results.csv /results/results.csv
Expand Down