@@ -13,6 +13,7 @@ interface InferenceTableProps {
1313 data : InferenceData [ ] ;
1414 chartDefinition : ChartDefinition ;
1515 selectedYAxisMetric : string ;
16+ percentile ?: string ;
1617}
1718
1819/** Format a number for table display — picks sensible precision based on magnitude. */
@@ -28,10 +29,14 @@ export default function InferenceTable({
2829 data,
2930 chartDefinition,
3031 selectedYAxisMetric,
32+ percentile = 'median' ,
3133} : InferenceTableProps ) {
3234 const yPath = chartDefinition [ selectedYAxisMetric as keyof ChartDefinition ] as string | undefined ;
3335 const yLabel = chartDefinition [ `${ selectedYAxisMetric } _label` as keyof ChartDefinition ] as string ;
3436 const xLabel = chartDefinition . x_label ;
37+ const percentileLabel = percentile === 'median' ? 'Median' : percentile . toUpperCase ( ) ;
38+ const ttftKey = `${ percentile } _ttft` as keyof InferenceData ;
39+ const interactivityKey = `${ percentile } _intvty` as keyof InferenceData ;
3540
3641 const rooflineDir = chartDefinition [
3742 `${ selectedYAxisMetric } _roofline` as keyof ChartDefinition
@@ -97,21 +102,21 @@ export default function InferenceTable({
97102 className : 'tabular-nums' ,
98103 } ,
99104 {
100- header : 'Median TTFT (ms)' ,
105+ header : ` ${ percentileLabel } TTFT (ms)` ,
101106 align : 'right' ,
102- cell : ( row ) => fmt ( ( row . median_ttft ?? 0 ) * 1000 , 0 ) ,
103- sortValue : ( row ) => row . median_ttft ?? 0 ,
107+ cell : ( row ) => fmt ( ( ( row [ ttftKey ] as number | undefined ) ?? 0 ) * 1000 , 0 ) ,
108+ sortValue : ( row ) => ( row [ ttftKey ] as number | undefined ) ?? 0 ,
104109 className : 'tabular-nums' ,
105110 } ,
106111 {
107- header : 'Median Interactivity (tok/s)' ,
112+ header : ` ${ percentileLabel } Interactivity (tok/s)` ,
108113 align : 'right' ,
109- cell : ( row ) => fmt ( row . median_intvty ?? 0 , 1 ) ,
110- sortValue : ( row ) => row . median_intvty ?? 0 ,
114+ cell : ( row ) => fmt ( ( row [ interactivityKey ] as number | undefined ) ?? 0 , 1 ) ,
115+ sortValue : ( row ) => ( row [ interactivityKey ] as number | undefined ) ?? 0 ,
111116 className : 'tabular-nums' ,
112117 } ,
113118 ] ,
114- [ yPath , yLabel , xLabel ] ,
119+ [ yPath , yLabel , xLabel , percentileLabel , ttftKey , interactivityKey ] ,
115120 ) ;
116121
117122 return (
0 commit comments