Hive
feat(server, noora): rework Xcode Cache widgets with transfer/latency/throughput splits
GitHub issue · Closed
Purpose
Reworks the Xcode Cache page widgets so users can see a combined view of every cache metric alongside the underlying split.
- Replaces the separate Cache downloads + Cache uploads widgets with a single Cache transfer widget that has a dropdown to switch between combined, downloads, and uploads.
- Adds a Cache latency widget (combined / read / write) and a Cache throughput widget (combined / downloads / uploads). Both follow the same dropdown widget pattern as the cache hit rate widget.
- Each chart now renders three lines (combined + the two split series), and each widget gets a distinct default color (transfer orange, latency pink, throughput yellow) wired through the legend bar, dropdown dot, and chart line so they read as a row of four rather than a sea of purple.
Data source
All three new analytics derive from the existing per-task cas_outputs ClickHouse table that the Tuist CLI / Xcode CAS plugin already writes at build completion. That table carries size, compressed_size, duration, and operation for every upload/download, so no schema changes or new client-side instrumentation are needed.
Project-level aggregation joins cas_outputs with build_runs on project_id and is consolidated through a single cas_action_metrics/3 helper that returns size/duration/count buckets plus current and previous-period totals — the public functions (cas_uploads_analytics, cas_downloads_analytics, cas_transfer_analytics, cas_latency_analytics, cas_throughput_analytics) all derive from it. Latency is the event-count-weighted average across the chosen actions; throughput is total bytes divided by total duration.
Other notes for reviewers
- New generic
SplitDropdownWidgetcomponent (lives next toPercentileDropdownWidget) — could be reused for other combined/split metrics later. - New
formatBytesPerSecondNoora chart formatter for throughput axes/tooltips. - Per-widget dropdown selection is persisted via
transfer-type,latency-type,throughput-typequery params. - Includes a changelog entry under
server/priv/marketing/changelog/. - No migrations and no changes to Kura, the cache webhook, or
cas_events— the original draft of this PR added aduration_mscolumn there before realisingcas_outputsalready had the data.
How to test locally
mise run devand open a project with cacheable build runs at/<account>/<project>/xcode-cache.- Confirm the four widgets render with distinct legend colors (purple / orange / pink / yellow) and that each opens a dropdown matching the cache hit rate widget.
- Click each widget to switch the chart below — chart should show three lines whose colors match the widget legend.
- Use the dropdown on each widget to switch the headline value between combined / downloads / uploads (or read / write for latency) and verify the legend bar color updates accordingly.
No GitHub comments yet.