Skip to content

Commit

Permalink
improve script config
Browse files Browse the repository at this point in the history
  • Loading branch information
steveww committed Oct 22, 2018
1 parent 1a50093 commit 7e4b55b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions load-gen/load-gen.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/sh

# set -x

# Changing the NUM_CLIENTS environment variable varies the load on the application
# The bigger the number the more requests, the bigger the load
NUM_CLIENTS=1

# HOST where Stan's Robot Shop web UI is running
HOST="http://localhost:8080"

# Set SILENT to anything to have all output discarded. Useful when running load for
# a long time to stop the disk filling up with copious log messages
# -e 'SILENT=1'
if [ ! -f ../.env ]
then
echo "Please run this script from the load-gen directory"
exit 1
fi

# get the tag info
eval $(egrep '[A-Z]+=' ../.env)
Expand All @@ -20,17 +28,17 @@ then
-d \
--rm \
--network=host \
-e 'HOST=http://localhost:8080' \
-e 'NUM_CLIENTS=1' \
-e "HOST=$HOST" \
-e "NUM_CLIENTS=$NUM_CLIENTS" \
-e 'SILENT=1' \
${REPO}/rs-load:${TAG}
else
docker run \
-it \
--rm \
--network=host \
-e 'HOST=http://localhost:8080' \
-e 'NUM_CLIENTS=1' \
-e "HOST=$HOST" \
-e "NUM_CLIENTS=$NUM_CLIENTS" \
${REPO}/rs-load:${TAG}
fi

0 comments on commit 7e4b55b

Please sign in to comment.