From af54b6bd3073fe51f13fc60f7e40b50e1027484a Mon Sep 17 00:00:00 2001 From: Andrey Cheptsov Date: Tue, 1 Dec 2026 14:24:34 +0100 Subject: [PATCH] Show single-concurrency preset benchmarks as values A preset benchmarked at one concurrency drew a bar chart with a single bar across the whole plot and no value on it. Its benchmark now shows as values in the same label/value grid as Details and Constraints. Presets with several concurrencies keep the tabs and charts. Co-Authored-By: Claude Opus 5.5 --- .../pages/Presets/Details/Benchmark/index.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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];