Skip to content

Commit

Permalink
Fix incorrectly updating stat history
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Nov 8, 2024
1 parent bb0efad commit b299633
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion locust/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def get_html_report(
{**exc, "nodes": ", ".join(exc["nodes"])} for exc in environment.runner.exceptions.values()
]

update_stats_history(environment.runner)
if stats.history and stats.history[-1]["time"] < end_time:
update_stats_history(environment.runner)
history = stats.history

is_distributed = isinstance(environment.runner, MasterRunner)
Expand Down
2 changes: 1 addition & 1 deletion locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def stats_history(runner: Runner) -> None:
while True:
if not runner.stats.total.use_response_times_cache:
break
if runner.state != "stopped":
if runner.state != "ready" and runner.state != "stopped":
update_stats_history(runner)

gevent.sleep(HISTORY_STATS_INTERVAL_SEC)
Expand Down

0 comments on commit b299633

Please sign in to comment.