locust breaking changes

This commit is contained in:
Steve Waterworth
2020-06-23 10:37:11 +01:00
parent 4242f59c3f
commit 1ab2ee68af
3 changed files with 7 additions and 9 deletions

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