RUM-7174 Introduce the setNetworkSettledInitialResourceIdentifier API#2424
Conversation
8f6c29d to
dd94ef2
Compare
dd94ef2 to
a151145
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/view-loading-times #2424 +/- ##
==============================================================
+ Coverage 69.96% 70.10% +0.14%
==============================================================
Files 775 775
Lines 28647 28676 +29
Branches 4805 4807 +2
==============================================================
+ Hits 20042 20103 +61
+ Misses 7277 7249 -28
+ Partials 1328 1324 -4
|
| * a threshold of 100ms. | ||
| * @param initialResourceIdentifier the [InitialResourceIdentifier] to use. | ||
| */ | ||
| fun setNetworkSettledInitialResourceIdentifier(initialResourceIdentifier: InitialResourceIdentifier): Builder { |
There was a problem hiding this comment.
Note
This function's name is a bit long, maybe we can rename it to setInitialResourceIdentifier?
There was a problem hiding this comment.
Glad that you mentioned it...was also thinking about it but I was afraid that only using setInitialResourceIdentifier will not be explicit enough. I guess we are ok though.
| private var anrDetectorExecutorService: ExecutorService? = null | ||
| internal var anrDetectorRunnable: ANRDetectorRunnable? = null | ||
| internal lateinit var appContext: Context | ||
| internal var networkSettledInitialResourceIdentifier: InitialResourceIdentifier = NoOpInitialResourceIdentifier() |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
| private val sessionEndedMetricDispatcher: SessionMetricDispatcher, | ||
| private val sessionListener: RumSessionListener? | ||
| private val sessionListener: RumSessionListener?, | ||
| private val networkSettledResourceIdentifier: InitialResourceIdentifier |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
| frameRateVitalMonitor: VitalMonitor, | ||
| private val sessionListener: RumSessionListener?, | ||
| applicationDisplayed: Boolean, | ||
| networkSettledResourceIdentifier: InitialResourceIdentifier, |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
| private val frameRateVitalMonitor: VitalMonitor, | ||
| internal var applicationDisplayed: Boolean, | ||
| internal val sampleRate: Float, | ||
| internal val networkSettledResourceIdentifier: InitialResourceIdentifier, |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
| private val interactionToNextViewMetricResolver: InteractionToNextViewMetricResolver, | ||
| private val networkSettledMetricResolver: NetworkSettledMetricResolver = | ||
| NetworkSettledMetricResolver(internalLogger = sdkCore.internalLogger) | ||
| private val networkSettledMetricResolver: NetworkSettledMetricResolver |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
| sessionListener: RumSessionListener, | ||
| internal val executorService: ExecutorService | ||
| internal val executorService: ExecutorService, | ||
| internal val networkSettledResourceIdentifier: InitialResourceIdentifier |
There was a problem hiding this comment.
Note
Same, maybe we can rename this property to initialResourceIdentifier.
85893e3 to
48ab0a2
Compare
…-strategy-for-ttns-requests-identification RUM-7174 Introduce the setNetworkSettledInitialResourceIdentifier API
…-strategy-for-ttns-requests-identification RUM-7174 Introduce the setNetworkSettledInitialResourceIdentifier API
What does this PR do?
Following the RFC we are introducing the
setNetworkSettledInitialResourceIdentifierAPI as part of theRumConfiguration#Builderin order to provide external control on which resource started in a view will be take partin the
time-to-network-settledmetric computation. The default identifier being used is aTimeBasedResourceIdentifierwith a default threshold set to100ms. This could be re - used by our users in the ConfigurationBuilderby changing thetime intervalto their internal needs.In addition to this this PR contain a small but very important fix in the
RumViewScopewhere we make sure theNetworkSettledMetricResolveris notified for theview stoppedonly if the event was sent for the current view and only once.Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)