diff --git a/application/locustfile.py b/application/locustfile.py index bb4fde3932f204b01054c8816c8bdd6c7f7cf363..5cc90f33ce0c99a127c9f3d307561a916e8abf33 100644 --- a/application/locustfile.py +++ b/application/locustfile.py @@ -1,8 +1,16 @@ import random -from locust import HttpUser, task, between +from locust import HttpUser, task, between, events from locust.exception import StopUser -header={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} + +@events.init_command_line_parser.add_listener +def _(parser): + parser.add_argument("--token", + type=str, + env_var="LOCUST_MY_ARGUMENT", + is_secret=True, + help=":8080/token", + default="") class StudentActor(HttpUser):