Skip to content

Show selected percentile in agentic x-axis titles for Interactivity / E2E Latency / 智能体场景 Interactivity 与 E2E Latency x 轴标题显示所选百分位 - #639

Merged
cquil11 merged 2 commits into
masterfrom
feat/agentic-percentile-axis-labels
Jul 28, 2026
Merged

Show selected percentile in agentic x-axis titles for Interactivity / E2E Latency / 智能体场景 Interactivity 与 E2E Latency x 轴标题显示所选百分位#639
cquil11 merged 2 commits into
masterfrom
feat/agentic-percentile-axis-labels

Conversation

@cquil11

@cquil11 cquil11 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What changed

  • On agentic scenarios only, the x-axis titles for the regular Interactivity and E2E Latency x-axis modes now carry the selected latency percentile — e.g. "P90 Interactivity (tok/s/user)", "P75 End-to-end Latency (s)".
  • Extracted the agentic label rewrite in useChartData.stableChartDefinitions into an exported pure helper applyAgenticPercentileToXLabel(label, pctlWord): it prefixes the percentile when the configured label has no leading statistic word, and still replaces an existing prefix (e.g. the TTFT override label "P90 Time To First Token (s)" → "P75 …") without double-prefixing.
  • Unit tests (useChartData.test.ts): prefix on interactivity/e2e labels, p75 switch, replace-not-double on existing prefixes, Median/Mean replacement, no-op when already correct, mid-label statistic words untouched.
  • Cypress (ttft-x-axis-toggle.cy.ts): asserts "P90 Interactivity (tok/s/user)" and "P90 End-to-end Latency (s)" render in the chart SVG on agentic, "P75 Interactivity (tok/s/user)" after switching the percentile selector, no percentile prefix on the fixed-seq default scenario, and the same "P90 Interactivity (tok/s/user)" label with an ?unofficialrun= overlay loaded.

Why

  • Agentic scenarios plot percentile fields (p75_intvty/p90_intvty, p75_e2el/p90_e2el). The chart heading, the TTFT mode label, and the derived-mode labels already show the percentile, but the base Interactivity / E2E Latency axis titles rendered the raw config labels ("Interactivity (tok/s/user)") because the previous rewrite only replaced an existing leading percentile word — the base config labels have none, so nothing was added.
  • Fixed-sequence (non-agentic) labels are unchanged (isAgentic guard at the call site).
  • Overlay support: works for both official runs and ?unofficialrun= overlays — the overlay path renders on the same base chart and ChartDisplay passes graph.chartDefinition.x_label from the same stableChartDefinitions output, so one fix covers both; verified with a Cypress overlay assertion. /zh pages reuse the English axis label for these modes (technical terms with units, same as the existing TTFT label behavior), so no zh-side change is needed.

中文说明

  • 仅在智能体(agentic)场景下,常规 InteractivityE2E Latency x 轴模式的坐标轴标题现在会带上所选延迟百分位,例如 "P90 Interactivity (tok/s/user)"、"P75 End-to-end Latency (s)"。
  • useChartData.stableChartDefinitions 中的标签改写逻辑提取为导出的纯函数 applyAgenticPercentileToXLabel(label, pctlWord):配置标签没有统计词前缀时补上所选百分位;已有前缀(如 TTFT 覆盖标签 "P90 Time To First Token (s)" → "P75 …")时替换而不重复叠加。
  • 单元测试(useChartData.test.ts)覆盖:interactivity/e2e 标签加前缀、切换到 p75、已有前缀时替换不重复、Median/Mean 替换、标签已正确时不变、标签中间的统计词不受影响。
  • Cypress(ttft-x-axis-toggle.cy.ts)断言:agentic 下图表 SVG 渲染 "P90 Interactivity (tok/s/user)" 与 "P90 End-to-end Latency (s)";切换百分位后显示 "P75 Interactivity (tok/s/user)";固定序列默认场景不带百分位前缀;加载 ?unofficialrun= 叠加时同样显示带百分位的标签。
  • 原因:agentic 场景绘制的是百分位字段(p75_intvty/p90_intvtyp75_e2el/p90_e2el),图表标题、TTFT 模式及派生模式的标签均已显示百分位,唯独这两个基础模式的轴标题仍是原始配置标签——原有改写只替换已存在的前缀,而基础标签没有前缀,因此未生效。固定序列标签保持不变。叠加路径复用同一 chartDefinition 标签,一处修复同时覆盖官方与非官方运行;/zh 页面沿用英文轴标签(含单位的技术术语,与现有 TTFT 标签行为一致),无需额外改动。

🤖 Generated with Claude Code


Note

Low Risk
Display-only label logic gated to agentic sequences; fixed-seq and data plumbing are untouched.

Overview
Agentic Interactivity and E2E Latency x-axis titles now include the selected latency percentile (e.g. P90 Interactivity (tok/s/user)), matching the percentile fields actually plotted. Fixed-sequence scenarios are unchanged.

The prior inline label rewrite only replaced an existing leading statistic word, so base config labels without a prefix never got a percentile. That logic is extracted into applyAgenticPercentileToXLabel, which prefixes when needed and still replaces Median/Mean/P90-style prefixes without doubling.

Tests: Vitest covers the helper; Cypress asserts SVG axis text for agentic modes, p75 after percentile change, no prefix on fixed-seq default, and the same labels with unofficial-run overlays. Derived-metrics stubs were extended and wired earlier in suite setup to avoid loading skeletons when defaults fetch derived metrics.

Reviewed by Cursor Bugbot for commit 6cf6a8e. Bugbot is set up for automated code reviews on this repo. Configure here.

…2E Latency x-axis labels

On agentic scenarios the chart plots percentile fields (p75_intvty /
p90_intvty, p75_e2el / p90_e2el), but the x-axis labels for the regular
Interactivity and E2E Latency modes still rendered the raw config labels
("Interactivity (tok/s/user)", "End-to-end Latency (s)") because the
agentic relabel only REPLACED an existing leading statistic word and the
base config labels carry none. Extract the rewrite into
applyAgenticPercentileToXLabel, which prefixes the selected percentile
when absent and still replaces an existing prefix (TTFT override labels)
without doubling. Fixed-seq labels are untouched (isAgentic guard), and
the unofficial-run overlay path shares the same chartDefinition label so
it is covered by the same fix.

中文:智能体(agentic)场景下图表绘制的是百分位字段(p75_intvty /
p90_intvty、p75_e2el / p90_e2el),但常规 Interactivity 与 E2E Latency
模式的 x 轴标题仍显示原始配置标签,未带百分位前缀。本次将改写逻辑提取为
applyAgenticPercentileToXLabel:标签无统计词前缀时补上所选百分位,已有
前缀(如 TTFT 覆盖标签)时替换而不重复。固定序列场景标签保持不变;
非官方运行叠加路径复用同一 chartDefinition 标签,因此同样生效。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cquil11
cquil11 requested a review from adibarra as a code owner July 28, 2026 21:32
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment Jul 28, 2026 9:53pm

Request Review

…ult x-axis mode

The agentic percentile axis-label assertions relied on Interactivity being
the agentic default x-axis mode. A parallel change makes OSL / E2EL the
agentic default, which would break these assertions on merge regardless of
landing order. Click the Interactivity / E2E mode buttons explicitly before
asserting labels, stub /api/v1/derived-agentic-metrics before the agentic
visits (so a derived default mode never sits on its loading skeleton), and
add the osl_per_e2el fields to the derived-metrics fixture. Fixed-seq
default assertions are unchanged.

中文:智能体百分位轴标签断言此前依赖 Interactivity 作为智能体默认
x 轴模式;另一并行改动将默认模式改为 OSL / E2EL,无论合并顺序都会
使这些断言失效。现改为在断言前显式点击 Interactivity / E2E 模式按钮,
在访问智能体页面前 stub /api/v1/derived-agentic-metrics(避免派生
默认模式停留在加载骨架屏),并在派生指标 fixture 中补充
osl_per_e2el 字段。固定序列默认断言保持不变。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cquil11
cquil11 merged commit f6db0a3 into master Jul 28, 2026
24 checks passed
@cquil11
cquil11 deleted the feat/agentic-percentile-axis-labels branch July 28, 2026 21:56
cquil11 added a commit that referenced this pull request Jul 28, 2026
…c-osl-e2el-metric

Conflict resolution in ttft-x-axis-toggle.cy.ts: keep this branch's shared
interceptDerivedAgenticMetrics helper (the spec-local stub with retired
metric fields dies), keep the OSL / E2EL default-mode test, and carry
forward #639's mode-explicit percentile axis-label tests unchanged.

中文:合并 master(PR #639 百分位轴标签)。冲突解析:保留本分支共享的
派生指标 stub 辅助函数与 OSL / E2EL 默认模式测试,完整保留 #639 的
显式模式百分位轴标签测试。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant