v144 · performance
Performance + Event Timing: InteractionCount
The Event Timing API is part of the Performance Timeline and is used to measure the performance of user interactions. Certain Events will have an interactionId value assigned to them, and this is useful for grouping related interactions based on common physical user inputs or gestures.
concepts
-
Interaction Counter
A site-wide counter of unique user interactions, exposed alongside the existing PerformanceEventTiming entries. Lets RUM tools compute interaction density.
-
INP Budget Tracker
Compute live INP using PerformanceEventTiming plus the new interactionCount counter — the recipe every RUM library uses.
-
Density Heatmap
Cross-reference
interactionCountwith the timeline to plot interaction density — hot bursts vs idle — over a rolling 60-second window. -
INP Profiler
Click fast, medium, and slow handlers to generate interactions with different latencies. Live INP (p98), max, and mean metrics update in real time alongside a good/needs-improvement/poor histogram — all driven by
PerformanceEventTimingandperformance.interactionCount.
why it shipped
Used to count the number of important real user interactions with a page. This is distinct from counting the number of events that Event Timing measures (because a single physical user gesture may fire many, variable number, of specific events, depending on the type of input and event target and page design) but you can already count interactions (inconveniently) by just counting the number of unique interactionId values in Event Timing API.