From 1c74db81a2c26a8336aebfa57be3f312d3fad859 Mon Sep 17 00:00:00 2001 From: Samuel Spagl Date: Wed, 7 Sep 2022 09:41:47 +0200 Subject: [PATCH] renamed `shape_last_state` to `shape_last_tick` --- locust/runners.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locust/runners.py b/locust/runners.py index 92a43a2a24..a0f1cfce34 100644 --- a/locust/runners.py +++ b/locust/runners.py @@ -118,7 +118,7 @@ def __init__(self, environment: "Environment") -> None: self.state = STATE_INIT self.spawning_greenlet: Optional[gevent.Greenlet] = None self.shape_greenlet: Optional[gevent.Greenlet] = None - self.shape_last_state: Union[Tuple[int, float], Tuple[int, float, Optional[List[Type[User]]]], None] = None + self.shape_last_tick: Union[Tuple[int, float], Tuple[int, float, Optional[List[Type[User]]]], None] = None self.current_cpu_usage: int = 0 self.cpu_warning_emitted: bool = False self.worker_cpu_warning_emitted: bool = False @@ -362,9 +362,9 @@ def shape_worker(self) -> None: else: self.stop() self.shape_greenlet = None - self.shape_last_state = None + self.shape_last_tick = None return - elif self.shape_last_state == current_tick: + elif self.shape_last_tick == current_tick: gevent.sleep(1) else: if len(current_tick) == 2: @@ -387,7 +387,7 @@ def shape_worker(self) -> None: # `(user_count - prev_user_count) / spawn_rate` in order to limit the runtime # of each load test shape stage. self.start(user_count=user_count, spawn_rate=spawn_rate, user_classes=user_classes) - self.shape_last_state = current_tick + self.shape_last_tick = current_tick def stop(self) -> None: """ @@ -410,7 +410,7 @@ def stop(self) -> None: if self.shape_greenlet is not None: self.shape_greenlet.kill(block=True) self.shape_greenlet = None - self.shape_last_state = None + self.shape_last_tick = None self.stop_users(self.user_classes_count) @@ -889,7 +889,7 @@ def stop(self, send_stop_to_client: bool = True) -> None: ): self.shape_greenlet.kill(block=True) self.shape_greenlet = None - self.shape_last_state = None + self.shape_last_tick = None self._users_dispatcher = None