From f2184d3dbe47a3be0e7edc09df73ddaeef05da81 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Wed, 30 Jul 2014 11:55:10 -0700 Subject: [PATCH] Tweak examples/unfinished/benchmark script --- examples/unfinished/benchmark/run-local.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/unfinished/benchmark/run-local.sh b/examples/unfinished/benchmark/run-local.sh index 3c533ad54a..9fecfcaba9 100755 --- a/examples/unfinished/benchmark/run-local.sh +++ b/examples/unfinished/benchmark/run-local.sh @@ -1,8 +1,12 @@ #!/bin/bash PORT=9000 -NUM_CLIENTS=10 -DURATION=120 +if [ -z "$NUM_CLIENTS" ]; then + NUM_CLIENTS=10 +fi +if [ -z "$DURATION" ]; then + DURATION=120 +fi REPORT_INTERVAL=10 set -e @@ -20,7 +24,7 @@ pkill -f "$PROJDIR/.meteor/local/db" || true ../../../meteor reset || true # start the benchmark app -../../../meteor --production --settings "scenarios/${SCENARIO}.json" --port 9000 & +../../../meteor --production --settings "scenarios/${SCENARIO}.json" --port ${PORT} & OUTER_PID=$! echo "Waiting for server to come up" @@ -30,12 +34,13 @@ function wait_for_port { sleep 1 N=$(($N+1)) if [ $N -ge $2 ] ; then + curl -v "$1" || true echo "Timed out waiting for port $1" exit 2 fi done } -wait_for_port "http://localhost:9001" 60 +wait_for_port "http://localhost:${PORT}" 60 echo "Starting phantoms"