Collapse results and alerts by default in the reports list API#926
Conversation
🤖 Claude Code ReviewPR: #926 Cargo commands are blocked in this environment, so I'll base the review on the diff analysis. Here is my review. Code Review: Collapse results and alerts by default in the reports list APISummaryThis PR makes the reports list endpoint ( Strengths
Observations / Minor Points
VerdictNo blocking issues. The core invariant (collapsed counts == full counts) is the main risk, and it's directly locked down by tests. I was unable to run Model: claude-opus-4-8 |
978b032 to
210b67f
Compare
|
| Branch | claude/collapse-report-list |
| Testbed | intel-v1 |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| Adapter::Json | 📈 view plot 🚷 view threshold | 4.74 µs(+1.94%)Baseline: 4.65 µs | 4.90 µs (96.65%) |
| Adapter::Magic (JSON) | 📈 view plot 🚷 view threshold | 4.59 µs(+1.67%)Baseline: 4.52 µs | 4.72 µs (97.28%) |
| Adapter::Magic (Rust) | 📈 view plot 🚷 view threshold | 25.40 µs(-0.90%)Baseline: 25.63 µs | 26.75 µs (94.96%) |
| Adapter::Rust | 📈 view plot 🚷 view threshold | 3.50 µs(+0.26%)Baseline: 3.50 µs | 3.60 µs (97.26%) |
| Adapter::RustBench | 📈 view plot 🚷 view threshold | 3.51 µs(+0.48%)Baseline: 3.49 µs | 3.60 µs (97.50%) |
210b67f to
480fcc9
Compare
BREAKING CHANGE: GET /v0/projects/{project}/reports now omits the results
and alerts for each report by default. One console reports page could be
~150 MB of JSON, fully buffered by Dropshot before send, driving server
memory spikes and edge egress. Set the new expand query param to true
(bencher report list --expand) to restore the previous behavior.
A new counts field summarizes each report: the number of benchmarks and
distinct measures per iteration and the total and active alerts. It is
always present, computed from the loaded data on the full path and with
cheap aggregate queries on the collapsed path.
The console now renders report rows from counts, lazily fetches the full
report when one is expanded on the perf page, and bootstraps the default
perf plot with a single get-one request.
480fcc9 to
97dd64b
Compare
Summary
BREAKING CHANGE:
GET /v0/projects/{project}/reportsnow omits theresultsandalertsfor each report by default. One console reports page could be large JSON, fully buffered by Dropshot before send, driving server memory spikes and a large amount of edge egress. Set the newexpandquery param totrue(bencher report list --expand) to restore the previous full-report behavior; the console UI does not use it.A new
countsfield is always present on every report response and mirrors the collapsed fields:Changes
JsonReport.resultsand.alertsare nowOptionwithskip_serializing_if; newcounts: JsonReportCountsfield andexpandquery paramQueryReport::into_jsontakes aReportMode { Full, Collapsed }enum so the compiler forces every call site to choose; only the list endpoint defaults toCollapsed(GET-one, POST, andbencher runstayFull)report_benchmark JOIN metricplus a status-only alert query; the full path computes counts in memory from the loaded data, and a test asserts both paths agreeReportRowrenders fromcounts; the perf Reports tab lazily fetches GET-one when a report is expanded; the perf page default plot bootstrap fetches the first report via GET-onebencher report list --expandflag;bencher runreads its alert count fromcounts;bencher_commenthandles theOptionfieldsopenapi.jsonandbencher.tsCompatibility
An older CLI's
bencher report listcannot parse the new default list response (its generated type requiresresults). Everything else, including olderbencher run, keeps working.Testing
expand=true, GET-one and POST stay full)--expand, and alert counts end to end