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';
11
11
12
12
export const selectBenchmarks = ( state : RootState ) => state . benchmarks . data ;
13
13
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
+
14
26
export const selectMetricsSummaryLineData = createSelector (
15
27
[ selectBenchmarks , selectSloState ] ,
16
28
( benchmarks , sloState ) => {
@@ -39,10 +51,12 @@ export const selectMetricsSummaryLineData = createSelector(
39
51
const percentile = benchmark [ metric ] . percentileRows . find (
40
52
( p ) => p . percentile === selectedPercentile
41
53
) ;
54
+ const yValue = percentile ?. value ?? 0 ;
55
+ const units = getUnitsByMetric ( metric ) ;
42
56
data . push ( {
43
57
x : benchmark . requestsPerSecond ,
44
- y : percentile ?. value ?? 0 ,
45
- label : benchmark . strategyDisplayStr ,
58
+ y : yValue ,
59
+ label : ` ${ benchmark . strategyDisplayStr } ${ yValue } ${ units } ` ,
46
60
} ) ;
47
61
} ) ;
48
62
You can’t perform that action at this time.
0 commit comments