Commit b8047180 authored by Petr Kalashnikov's avatar Petr Kalashnikov
Browse files

Make locust waiting time adjustable

parent b3736561
Pipeline #53837 failed with stage
in 2 minutes and 5 seconds
...@@ -60,3 +60,7 @@ transaction_service: ...@@ -60,3 +60,7 @@ transaction_service:
#wsdl: https://agr-bott-utv02.sfso.no/AgrBOTT_Utv02_WS/service.svc?BatchInputService/BatchInput #wsdl: https://agr-bott-utv02.sfso.no/AgrBOTT_Utv02_WS/service.svc?BatchInputService/BatchInput
# wsdl is file based for now, dfo is not able to deliver via api mannager # wsdl is file based for now, dfo is not able to deliver via api mannager
wsdl: wsdl/batchinputservice.wsdl wsdl: wsdl/batchinputservice.wsdl
locust_waiting_time:
min_time: 5.1
max_time: 7.5
...@@ -7,7 +7,8 @@ logger = logging.getLogger(__name__) ...@@ -7,7 +7,8 @@ logger = logging.getLogger(__name__)
ubw_config = bios.read("config.yaml") ubw_config = bios.read("config.yaml")
endpoints_list = ubw_config["rest"]["endpoints"] endpoints_list = ubw_config["rest"]["endpoints"]
headers = ubw_config["rest"]["headers"] headers = ubw_config["rest"]["headers"]
min_waiting_time = ubw_config["locust_waiting_time"]["min_time"]
max_waiting_time = ubw_config["locust_waiting_time"]["max_time"]
def get_endpoint(endpoint): def get_endpoint(endpoint):
return "/" + endpoints_list[endpoint]["url"] + "/" return "/" + endpoints_list[endpoint]["url"] + "/"
...@@ -111,4 +112,4 @@ class WebsiteTasks(TaskSet): ...@@ -111,4 +112,4 @@ class WebsiteTasks(TaskSet):
class WebsiteUser(HttpUser): class WebsiteUser(HttpUser):
tasks = [WebsiteTasks] tasks = [WebsiteTasks]
wait_time = between(5.100, 7.500) # to adjust in prod wait_time = between(min_waiting_time, max_waiting_time)
...@@ -93,11 +93,17 @@ class UbwRestBase(BaseModel): ...@@ -93,11 +93,17 @@ class UbwRestBase(BaseModel):
endpoints: UbwRestEndpoints = UbwRestEndpoints() endpoints: UbwRestEndpoints = UbwRestEndpoints()
class LocustWaitingTime(BaseModel):
min_time: float
max_time: float
class UbwClientConfig(BaseModel): class UbwClientConfig(BaseModel):
# Base config for rest endpoints # Base config for rest endpoints
rest: typing.Optional[UbwRestBase] rest: typing.Optional[UbwRestBase]
import_service: typing.Optional[UbwSoapService] import_service: typing.Optional[UbwSoapService]
transaction_service: typing.Optional[UbwSoapService] transaction_service: typing.Optional[UbwSoapService]
locust_waiting_time: typing.Optional[LocustWaitingTime]
class Begrep(BaseModel): class Begrep(BaseModel):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment