diff --git a/cart/package.json b/cart/package.json index 3acfc09..3fe6c94 100644 --- a/cart/package.json +++ b/cart/package.json @@ -12,7 +12,7 @@ "body-parser": "^1.18.1", "express": "^4.15.4", "redis": "^2.8.0", - "request": "^2.83.0", + "request": "^2.88.2", "pino": "^5.10.8", "express-pino-logger": "^4.0.0", "pino-pretty": "^2.5.0", diff --git a/load-gen/entrypoint.sh b/load-gen/entrypoint.sh index 5334455..aa56a03 100755 --- a/load-gen/entrypoint.sh +++ b/load-gen/entrypoint.sh @@ -38,8 +38,8 @@ fi echo "Starting $CLIENTS clients for ${RUN_TIME:-ever}" if [ "$SILENT" -eq 1 ] then - locust -f robot-shop.py --host "$HOST" --no-web -r 1 -c $NUM_CLIENTS $TIME > /dev/null 2>&1 + locust -f robot-shop.py --host "$HOST" --headless -r 1 -u $NUM_CLIENTS $TIME > /dev/null 2>&1 else - locust -f robot-shop.py --host "$HOST" --no-web -r 1 -c $NUM_CLIENTS $TIME + locust -f robot-shop.py --host "$HOST" --headless -r 1 -u $NUM_CLIENTS $TIME fi diff --git a/load-gen/requirements.txt b/load-gen/requirements.txt index 282a9af..8eaebfd 100644 --- a/load-gen/requirements.txt +++ b/load-gen/requirements.txt @@ -1 +1 @@ -locustio +locust diff --git a/load-gen/robot-shop.py b/load-gen/robot-shop.py index a2f0807..5d3a95f 100644 --- a/load-gen/robot-shop.py +++ b/load-gen/robot-shop.py @@ -1,9 +1,11 @@ import os -from locust import HttpLocust, TaskSet, task +from locust import HttpUser, task, between from random import choice from random import randint -class UserBehavior(TaskSet): +class UserBehavior(HttpUser): + wait_time = between(2, 10) + def on_start(self): """ on_start is called when a Locust start before any task is scheduled """ print('Starting') @@ -69,7 +71,3 @@ class UserBehavior(TaskSet): self.client.post('/api/payment/pay/partner-57', json=cart) -class WebsiteUser(HttpLocust): - task_set = UserBehavior - min_wait = 1000 - max_wait = 5000 diff --git a/pullbaseimages.sh b/pullbaseimages.sh index 2e055e1..2ae10da 100755 --- a/pullbaseimages.sh +++ b/pullbaseimages.sh @@ -6,6 +6,6 @@ do for IMAGE in $(awk '/^FROM/ { print $2 }' $DFILE) do echo "Pulling $IMAGE" - docker pull $IMAGE + docker pull $IMAGE done done