Why on_start and on_stop are Essential for Locust Users
PreviousSimulating Multiple User Types in LocustNextHow to use test_start and test_stop Events in Locust
Last updated
Last updated
from datetime import datetime
from locust import User, task, between, constant, constant_pacing
class MyUser(User):
wait_time = between(1, 5)
def on_start(self):
print("on start")
def on_stop(self):
print("on stop")
@task
def print_datetime(self):
print(datetime.now())