Skip to content

Commit

Permalink
add debug prints to show order
Browse files Browse the repository at this point in the history
  • Loading branch information
max-rocket-internet committed Mar 23, 2021
1 parent f61ae7d commit 2a002ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def start_shape(self):

def shape_worker(self):
logger.info("Shape worker starting")
print("1")
while self.state == STATE_INIT or self.state == STATE_SPAWNING or self.state == STATE_RUNNING:
new_state = self.environment.shape_class.tick()
if new_state is None:
Expand All @@ -344,6 +345,7 @@ def shape_worker(self):
elif self.shape_last_state == new_state:
gevent.sleep(1)
else:
print("2")
user_count, spawn_rate = new_state
logger.info("Shape test updating to %d users at %.2f spawn rate" % (user_count, spawn_rate))
self.start(user_count=user_count, spawn_rate=spawn_rate)
Expand Down Expand Up @@ -526,6 +528,7 @@ def cpu_log_warning(self):
return warning_emitted

def start(self, user_count, spawn_rate):
print("3")
self.target_user_count = user_count
num_workers = len(self.clients.ready) + len(self.clients.running) + len(self.clients.spawning)
if not num_workers:
Expand Down Expand Up @@ -553,6 +556,7 @@ def start(self, user_count, spawn_rate):
if self.state != STATE_RUNNING and self.state != STATE_SPAWNING:
self.stats.clear_all()
self.exceptions = {}
print("4")
self.environment.events.test_start.fire(environment=self.environment)

for client in self.clients.ready + self.clients.running + self.clients.spawning:
Expand Down

0 comments on commit 2a002ed

Please sign in to comment.