Repository navigation
fix(perf): leave unrecorded optional metrics out of perf detail rows - #1788
RizgarOzan wants to merge 1 commit into
Conversation
Runs without PD disaggregation have None for the steady ITL and PD handoff metrics, which failed PerfSummaryRow validation and made /api/v1/perf/detail return 500.
|
Thanks for the careful diagnosis and the detailed write-up — your root-cause analysis of #1786 is exactly right: Unfortunately we landed a fix for the same bug in #1790 (commit c8dc127) before this PR arrived, and it takes a different approach that makes this one hard to rebase:
Two consequences for this PR:
Beyond the overlap, there are two issues worth recording in case they come up again:
So we're going to close this as superseded — nothing here is a judgement on the quality of your investigation, which was spot on. If you'd like to keep contributing in this area, a genuinely uncovered case would be a regression test asserting that the p99 siblings of an unmeasured optional metric never leak a fabricated |
Fixes #1786
Since #1744,
_summary_valuesreturnsNoneforavg_steady_itl, the PD handoff metrics and their p99s when a run didn't record them.PerfSummaryRow.valuesisDict[str, float], sojson_responsefails validation and/api/v1/perf/detailreturns 500 for every normal (non-PD) run. The HTML report isn't affected because it only formats the columns it shows.build_run_detailnow dropsNonevalues from each row before building the response. The contract staysDict[str, float], and the dashboard already treats a missing key as empty (row.values[key] ?? '',formatMetricplaceholder), which also covers a sweep where only some runs have PD data.How I tested:
tests/perf/test_perf_archive.py: the existingtest_detail_returns_summary_fieldsfails onmainwith this 500 (CI doesn't run this file). Added an assertion for the missing key and a test with one PD run and one non-PD run. Both red onmain, 15/15 green with the fix.pytest tests/service tests/report tests/perf/test_perf_report_loader.py tests/perf/test_perf_visualizer.py tests/perf/test_rich_display.py: passing.tests/perf/test_stream_metrics.pyhas 6 failures on my Windows machine, same 6 onmain.test_ci_lite(mock LLM) passes, pre-commit clean.