Skip to content

Commit 642081a

Browse files
fix(agentic): default percentile to p90, surface only p90/p99
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3c96e91 commit 642081a

6 files changed

Lines changed: 10 additions & 13 deletions

File tree

packages/app/cypress/support/mock-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export function createMockInferenceContext(
189189
workflowInfo: null,
190190
selectedYAxisMetric: 'y_tpPerGpu',
191191
setSelectedYAxisMetric: namedStub('setSelectedYAxisMetric'),
192-
selectedPercentile: 'median',
192+
selectedPercentile: 'p90',
193193
setSelectedPercentile: namedStub('setSelectedPercentile'),
194194
selectedXAxisMetric: null,
195195
setSelectedXAxisMetric: namedStub('setSelectedXAxisMetric'),

packages/app/src/components/inference/InferenceContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function InferenceProvider({
134134
() => getUrlParam('i_e2e_xmetric') || null,
135135
);
136136
// Latency percentile applied to the chart x-axis for agentic scenarios.
137-
// Values: 'median' | 'p90' | 'p99' | 'p99.9'. Non-agentic charts ignore.
137+
// Values: 'p90' | 'p99'. Non-agentic charts ignore.
138138
const [selectedPercentile, setSelectedPercentile] = useState<string>(
139139
() => getUrlParam('i_pctl') || 'p90',
140140
);

packages/app/src/components/inference/hooks/useChartData.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function useChartData(
8383
selectedRunDate?: string,
8484
enabled = true,
8585
latestAvailableDate?: string,
86-
selectedPercentile = 'median',
86+
selectedPercentile = 'p90',
8787
/** When set, only series for these two registry GPU keys are shown (compare pages). */
8888
compareGpuPair?: readonly [string, string] | null,
8989
) {
@@ -261,12 +261,7 @@ export function useChartData(
261261
selectedPercentile,
262262
) as keyof AggDataEntry;
263263
if (adjusted !== xAxisField) {
264-
const pctlWord =
265-
selectedPercentile === 'median'
266-
? 'Median'
267-
: selectedPercentile === 'p99.9'
268-
? 'P99.9'
269-
: selectedPercentile.toUpperCase();
264+
const pctlWord = selectedPercentile.toUpperCase();
270265
xAxisLabel = xAxisLabel.replace(/^(Median|Mean|P90|P99(?:\.9)?)\b/iu, pctlWord);
271266
xAxisField = adjusted;
272267
}

packages/app/src/components/ui/chart-selectors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export function PercentileSelector({
315315
<LabelWithTooltip
316316
htmlFor={id}
317317
label="Latency Percentile"
318-
tooltip="Percentile of the latency distribution used for the chart x-axis. Agentic runs carry median/p90/p99/p99.9 variants; switch percentiles to see tail-latency behavior."
318+
tooltip="Percentile of the latency distribution used for the chart x-axis. Switch between p90 and p99 to see tail-latency behavior on agentic runs."
319319
/>
320320
<Select
321321
value={value}

packages/app/src/lib/data-mappings.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,17 @@ export const SEQUENCE_OPTIONS = Object.keys(SEQUENCE_CONFIG) as Sequence[];
186186
/**
187187
* Percentile of the latency distribution used for the chart x-axis when
188188
* viewing agentic traces. Agentic rows carry median/p90/p99/p99.9 variants
189-
* for ttft, ttlt (=e2el), and itl (and intvty derived from itl); p90 and
190-
* p99 are surfaced in the UI.
189+
* for ttft, ttlt (=e2el), and itl (and intvty derived from itl); only p90
190+
* and p99 are surfaced in the UI.
191191
*/
192192
export enum Percentile {
193193
P90 = 'p90',
194+
P99 = 'p99',
194195
}
195196

196197
const PERCENTILE_CONFIG: Record<Percentile, { label: string }> = {
197198
[Percentile.P90]: { label: 'p90' },
199+
[Percentile.P99]: { label: 'p99' },
198200
};
199201

200202
export const PERCENTILE_OPTIONS = Object.keys(PERCENTILE_CONFIG) as Percentile[];

packages/app/src/lib/url-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const PARAM_DEFAULTS: Record<UrlStateKey, string> = {
6767
i_seq: '8k/1k',
6868
i_prec: 'fp4',
6969
i_metric: 'y_tpPerGpu',
70-
i_pctl: 'median',
70+
i_pctl: 'p90',
7171
i_xmetric: 'p99_ttft',
7272
i_e2e_xmetric: '',
7373
i_scale: 'auto',

0 commit comments

Comments
 (0)