diff --git a/frontend/src/pages/Presets/Details/Benchmark/index.tsx b/frontend/src/pages/Presets/Details/Benchmark/index.tsx index a22ee23f5..c82b3daee 100644 --- a/frontend/src/pages/Presets/Details/Benchmark/index.tsx +++ b/frontend/src/pages/Presets/Details/Benchmark/index.tsx @@ -2,7 +2,7 @@ import React, { FC, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; -import { BarChart, Box, Container, Header, Loader, SelectCSD, Tabs } from 'components'; +import { BarChart, Box, ColumnLayout, Container, Header, Loader, SelectCSD, Tabs } from 'components'; import { useBenchmarkCharts } from './useBenchmarkCharts'; @@ -27,6 +27,28 @@ export const PresetBenchmark: FC = () => { ); + // A single concurrency has nothing to compare across: a chart would be one bar without its value, so the + // numbers show as values, the way Details and Constraints show theirs. + if (concurrencies.length === 1) + return ( + {t('presets.benchmark')}}> + +
+ {t('presets.concurrency')} +
{concurrencies[0]}
+
+ {charts + .filter(({ data }) => data.length > 0) + .map(({ title, formatValue, data }) => ( +
+ {title} +
{formatValue(data[0].y)}
+
+ ))} +
+
+ ); + const group = activeGroup ?? groups[0]; const groupCharts = charts.filter((chart) => chart.group === group); const chart = groupCharts.find(({ title }) => title === metricByGroup[group]) ?? groupCharts[0];