Skip to content

Commit

Permalink
Merge pull request #2600 from andrewbaldwin44/bugfix/2463
Browse files Browse the repository at this point in the history
Modern UI: Wrong chart's legend for overridden percentiles values
  • Loading branch information
cyberw committed Feb 11, 2024
2 parents c8730e6 + e2a453f commit 4e06922
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 54 deletions.
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

0 comments on commit 4e06922

Please sign in to comment.