RUM-7107 feat: Add Interaction To Next View metric in RUM #2153
+700
−53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What and why?
📦⏱️ This PR introduces the Interaction-to-Next-View (ITNV) metric to measure the time between the last action in a previous view and the moment the next view is started. This metric provides valuable insights into the time it takes for a view to be prepared and displayed after user interaction.
The ITNV value is reported under the following conditions:
.tap
,.click
, or.swipe
action occurred in the previous view, and the time between the last action and the start of the next view is less than 3 seconds.tap
and.click
, the measurement starts at the action's start time..swipe
, the measurement starts at the action's end time.Example: In the scenario below, A2 is the last action in the "Previous View." It’s a
.tap
action that occurs less than 3 seconds before the "Next View" starts. The ITNV value for "Next View" is calculated as the time from when the action starts to when the next view starts:The ITNV value is reported in the
view.interaction_to_next_view_time
attribute, in nanoseconds.This is the counterpart to Android PR #2417.
How?
The metric is modeled as an object implementing the
ITNVMetricTracking
interface, which tracks key events (action, view start, and view completion) and provides a method to retrieve the ITNV value:The ITNV metric object is created and managed by
RUMSessionScope
, enabling it to track actions and views throughout the session. When a view or action starts, a reference to this object is passed to the respective RUM scopes, allowing key events to be tracked via the interface.This design aligns with the solution implemented for the TTNS metric in #2125
Review checklist
make api-surface
)