Commit graph

2 commits

Author SHA1 Message Date
Katie Geer
2475a30b62
telemetry: Add latency metrics (#54454)
Self-Review Checklist:

- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Eric Holk <eric@zed.dev>
2026-04-22 22:22:10 +00:00
Eric Holk
a9e7b77672
gpui: Record input-to-frame latency histogram (#53822)
Adds instrumentation to track input-to-frame latency in GPUI windows,
helping diagnose input responsiveness issues.

## What this does

- Records the time between when an input event is dispatched and when
the resulting frame is presented, capturing worst-case latency when
multiple events are coalesced into a single frame.
- Tracks how many input events get coalesced per rendered frame.
- Both metrics are stored in
[HdrHistogram](https://docs.rs/hdrhistogram) instances with 3
significant digits of precision.
- Latency is only recorded when the input event actually causes a redraw
(i.e. marks the window dirty), so idle mouse moves and other no-op
events don't skew the data.
- Adds a `Dump Input Latency Histogram` command that opens a buffer with
a formatted report including percentile breakdowns and visual
distribution bars.

## Example output

The report shows percentile latencies, a bucketed distribution with bar
charts, and a per-frame event coalescing breakdown.

Release Notes:

- N/A

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Cole Miller <cole@zed.dev>
2026-04-16 17:38:58 +00:00