Merge branch 'master' into synthetics

This commit is contained in:
Cedric Ziel
2020-06-23 14:55:49 +02:00
committed by GitHub
5 changed files with 9 additions and 11 deletions

View File

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

View File

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

View File

@@ -1 +1 @@
locustio
locust

View File

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

View File

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