Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modern UI: Wrong chart's legend for overridden percentiles values #2600

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ The list of statistics parameters that can be modified is:
+-------------------------------------------+--------------------------------------------------------------------------------------+
| PERCENTILES_TO_CHART | List of response time percentiles in the screen of chart for Web UI |
+-------------------------------------------+--------------------------------------------------------------------------------------+
| MODERN_UI_PERCENTILES_TO_CHART | List of response time percentiles in the screen of chart for the modern Web UI |
+-------------------------------------------+--------------------------------------------------------------------------------------+
| PERCENTILES_TO_STATISTICS | List of response time percentiles in the screen of statistics for Web UI |
| | This parameter supports only modern UI |
+-------------------------------------------+--------------------------------------------------------------------------------------+
4 changes: 4 additions & 0 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def main():
logging.error("stats.PERCENTILES_TO_CHART parameter should be 2 parameters \n")
sys.exit(1)

if len(stats.MODERN_UI_PERCENTILES_TO_CHART) > 6:
logging.error("stats.MODERN_UI_PERCENTILES_TO_CHART parameter should be a maximum of 6 parameters \n")
sys.exit(1)

def is_valid_percentile(parameter):
try:
if 0 < float(parameter) < 1:
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locust/webui/dist/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-5730ea01.js"></script>
<script type="module" crossorigin src="/assets/index-698db2ae.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-5730ea01.js"></script>
<script type="module" crossorigin src="/assets/index-698db2ae.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
7 changes: 6 additions & 1 deletion locust/webui/src/components/SwarmCharts/SwarmCharts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const percentilesToChartLines = swarmTemplateArgs.percentilesToChart
}))
: [];

// Allows for the average stat to be shown in a different color than percentiles
const percentileColors = ['#9966CC', '#8A2BE2', '#8E4585', '#E0B0FF', '#C8A2C8', '#E6E6FA']
.slice(0, percentilesToChartLines.length)
.concat('#eeff00');

const availableSwarmCharts: ILineChartProps[] = [
{
title: 'Total Requests per Second',
Expand All @@ -27,7 +32,7 @@ const availableSwarmCharts: ILineChartProps[] = [
...percentilesToChartLines,
{ name: 'Average Response Time', key: 'totalAvgResponseTime' },
],
colors: ['#00ffee', '#eeff00'],
colors: percentileColors,
},
{
title: 'Number of Users',
Expand Down
Loading