Skip to content

Commit

Permalink
Add MODERN_UI_PERCENTILES_TO_CHART
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Dec 8, 2023
1 parent 8aa8562 commit c9a4b85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion locust/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_html_report(
"show_download_link": show_download_link,
"locustfile": escape(str(environment.locustfile)),
"tasks": task_data,
"percentiles_to_chart": stats_module.PERCENTILES_TO_CHART,
"percentiles_to_chart": stats_module.MODERN_UI_PERCENTILES_TO_CHART,
},
theme=theme,
static_js="\n".join(static_js),
Expand Down
3 changes: 2 additions & 1 deletion locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def resize_handler(signum: int, frame: Optional[FrameType]):
PERCENTILES_TO_REPORT = [0.50, 0.66, 0.75, 0.80, 0.90, 0.95, 0.98, 0.99, 0.999, 0.9999, 1.0]

PERCENTILES_TO_CHART = [0.50, 0.95]
MODERN_UI_PERCENTILES_TO_CHART = [0.95]


class RequestStatsAdditionError(Exception):
Expand Down Expand Up @@ -920,7 +921,7 @@ def stats_history(runner: "Runner") -> None:
current_response_time_percentiles = {
f"response_time_percentile_{percentile}": stats.total.get_current_response_time_percentile(percentile)
or 0
for percentile in PERCENTILES_TO_CHART
for percentile in MODERN_UI_PERCENTILES_TO_CHART
}

r = {
Expand Down
4 changes: 2 additions & 2 deletions locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def request_stats() -> Response:
f"response_time_percentile_{percentile}": environment.runner.stats.total.get_current_response_time_percentile(
percentile
)
for percentile in stats_module.PERCENTILES_TO_CHART
for percentile in stats_module.MODERN_UI_PERCENTILES_TO_CHART
}
else:
report[
Expand Down Expand Up @@ -592,7 +592,7 @@ def update_template_args(self):

if self.modern_ui:
percentiles = {
"percentiles_to_chart": stats_module.PERCENTILES_TO_CHART,
"percentiles_to_chart": stats_module.MODERN_UI_PERCENTILES_TO_CHART,
}
else:
percentiles = {
Expand Down

0 comments on commit c9a4b85

Please sign in to comment.