File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/ui/lib/store/slices/benchmarks Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,18 @@ import { selectSloState } from '../slo/slo.selectors';
1111
1212export const selectBenchmarks = ( state : RootState ) => state . benchmarks . data ;
1313
14+ const getUnitsByMetric = ( metric : string ) => {
15+ switch ( metric ) {
16+ case 'ttft' :
17+ case 'tpot' :
18+ return 'ms' ;
19+ case 'timePerRequest' :
20+ return 'sec' ;
21+ case 'throughput' :
22+ return 'tok/s' ;
23+ }
24+ } ;
25+
1426export const selectMetricsSummaryLineData = createSelector (
1527 [ selectBenchmarks , selectSloState ] ,
1628 ( benchmarks , sloState ) => {
@@ -39,10 +51,12 @@ export const selectMetricsSummaryLineData = createSelector(
3951 const percentile = benchmark [ metric ] . percentileRows . find (
4052 ( p ) => p . percentile === selectedPercentile
4153 ) ;
54+ const yValue = percentile ?. value ?? 0 ;
55+ const units = getUnitsByMetric ( metric ) ;
4256 data . push ( {
4357 x : benchmark . requestsPerSecond ,
44- y : percentile ?. value ?? 0 ,
45- label : benchmark . strategyDisplayStr ,
58+ y : yValue ,
59+ label : ` ${ benchmark . strategyDisplayStr } ${ yValue } ${ units } ` ,
4660 } ) ;
4761 } ) ;
4862
You can’t perform that action at this time.
0 commit comments