Files
hermes-agent/apps/shared
ghgoodreau 951efa9c39 feat(desktop): uncapped long-frame histogram under the shared-metrics opt-in
slow_frame friction caps at 5 per bucket per day (renderer) and 50 (backend)
and starts at 100 ms, so a janky day reads as "5" and mild stutter is
invisible. Add hermes.desktop.long_frames.sum: the existing
long-animation-frame/longtask observer now also folds every visible-window
frame into a per-UTC-day histogram (50-100 ms, 100-250 ms, 250 ms-1 s,
1-5 s, >=5 s; LoAF reports >=50 ms only, the first band sits below the
100 ms slow_frame threshold, the rest mirror slow_frame) plus the day's
visible time, kept in DayAggregate via withState and shipped once per finished day on its
own RPC, shared_metrics.desktop_long_frames (never per frame).

desktop_daily keeps main's contract. An older backend answers -32601 for the
new method; the renderer settles that day's histogram unrecorded so the day's
existing daily report still lands and the pending day clears. The visible-time
clock credits only visible spans and drops any span longer than the tick + 60 s,
so a suspend credits nothing.

Backend: a SUM_METRICS counter, one row per bucket whose value is the day's
frame count (uncapped), each carrying the visible-minutes bucket so a rate is
computable; a visible day with no long frames reports one `none` row.
update_rollup_state rows may carry an amount (SUM_METRICS only). Own
once-per-day latch, profile-scoped. Gated by
the renderer $desktopMetricsGate and the backend enabled(); upload by send.
slow_frame friction is unchanged.

Measured: a synthetic day of 300 frames at 120 ms reports
{bucket: 100ms_to_250ms, count: 300} and stores value 300 (was 5).
2026-11-20 14:42:55 -06:00
..