From 504aeb0ccaceb7120543369a37eedd53ece0f90b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <xpokorn8@fi.muni.cz>
Date: Wed, 3 May 2023 19:15:46 +0200
Subject: [PATCH] Adding parsing arguments from webUI

---
 application/locustfile.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/application/locustfile.py b/application/locustfile.py
index bb4fde39..5cc90f33 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):
-- 
GitLab