From bd0cef77f216e794ff4e1fc5cf66b304ba5368b7 Mon Sep 17 00:00:00 2001 From: Michael Barroco Date: Fri, 16 Jan 2026 10:38:15 +0100 Subject: [PATCH] [locust] Upgrade deprecated code to run with locust 2 --- monitoring/loadtest/locust_files/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/monitoring/loadtest/locust_files/client.py b/monitoring/loadtest/locust_files/client.py index e94d6f66ad..a4a603feca 100644 --- a/monitoring/loadtest/locust_files/client.py +++ b/monitoring/loadtest/locust_files/client.py @@ -33,11 +33,12 @@ def request(self, method: str, url: str, **kwargs): self.log_exception(real_method, name, start_time, Exception(msg)) else: total_time = int((time.time() - start_time) * 1000) - self._locust_environment.events.request_success.fire( + self._locust_environment.events.request.fire( request_type=real_method, name=name, response_time=total_time, response_length=0, + exception=None, ) return result @@ -45,12 +46,12 @@ def log_exception( self, real_method: str, name: str, start_time: float, e: Exception ): total_time = int((time.time() - start_time) * 1000) - self._locust_environment.events.request_failure.fire( + self._locust_environment.events.request.fire( request_type=real_method, name=name, response_time=total_time, - exception=e, response_length=0, + exception=e, )