mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Tweak examples/unfinished/benchmark script
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user