Tweak examples/unfinished/benchmark script

This commit is contained in:
Justin SB
2014-07-30 11:55:10 -07:00
parent 812a3af2cd
commit f2184d3dbe

View File

@@ -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"