RUM-7171 Implement the basic logic for interaction-to-next-view-metric #2417
Conversation
84f8e24 to
970eee7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/view-loading-times #2417 +/- ##
==============================================================
+ Coverage 69.87% 70.01% +0.14%
==============================================================
Files 770 775 +5
Lines 28559 28647 +88
Branches 4793 4805 +12
==============================================================
+ Hits 19955 20057 +102
+ Misses 7269 7265 -4
+ Partials 1335 1325 -10
|
970eee7 to
43a30e3
Compare
| // we need to keep at least 10 entries to be able to calculate the metric for consecutive views that | ||
| // are going to be created almost in the same time and will rely on the previous view interaction | ||
| private const val MAX_ENTRIES = 10 |
There was a problem hiding this comment.
question/ What are the "views created almost in the same time"? Does it mean very short navigation through series of views OR a problem with instrumentation?
There was a problem hiding this comment.
yes...also for views that are already stopped but still request the metric for some view updates. I also want to prepare it for 2 active views later, this logic will support that scenario also.
| internalLogger.log( | ||
| InternalLogger.Level.WARN, | ||
| InternalLogger.Target.MAINTAINER, | ||
| { "[ViewNetworkSettledMetric] No previous interaction found for this viewId:$viewId" } | ||
| ) |
There was a problem hiding this comment.
question/ Won't we always end up here for the initial view (ApplicationLaunch)? If so, this log won't be actionable.
There was a problem hiding this comment.
totally true....I guess we can condition this log by checking if there's any interaction yet added in the map, if not this is the applaunch. Good point. Actually added a test about this but never thought to condition the log.
43a30e3 to
d3a512d
Compare
What does this PR do?
In this PR we are adding the logic to compute and provide the
interaction-to-next-viewtime.Captures the time interval in nano seconds from the last user interaction on the previous view to when the current view becomes visible. The last user interaction needs to match some criteria that will
be detailed below where we explain how this metric is computed.
Is Directly associated with the lifecycle of the view: the end part of this interval is
equal with the moment when the new view scope creation but under the hood this is triggered by a system tied to the internal view lifecycle events. More details below in the computation explanation.
gantt title Timeline for Interaction-to-Next-View dateFormat HH:mm:ss section Interaction-to-Next-View User Interaction: des1, 00:00:00, 00:00:00:100 View Is Created :done, des2, 00:00:01, 00:00:02 View Becomes Visible :done, des3, after des2, 00:00:03 Interaction-to-Next-View Interval :active, des3, 00:00:00, 00:00:03Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)