-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUM-7174 Introduce the setNetworkSettledInitialResourceIdentifier API #2424
base: feature/view-loading-times
Are you sure you want to change the base?
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.11% +0.15%
==============================================================
Files 775 775
Lines 28647 28676 +29
Branches 4805 4807 +2
==============================================================
+ Hits 20042 20105 +63
+ Misses 7277 7251 -26
+ Partials 1328 1320 -8
|
* a threshold of 100ms. | ||
* @param initialResourceIdentifier the [InitialResourceIdentifier] to use. | ||
*/ | ||
fun setNetworkSettledInitialResourceIdentifier(initialResourceIdentifier: InitialResourceIdentifier): Builder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This function's name is a bit long, maybe we can rename it to setInitialResourceIdentifier
?
@@ -127,6 +130,7 @@ internal class RumFeature( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
@@ -33,7 +34,8 @@ internal class RumApplicationScope( | |||
private val memoryVitalMonitor: VitalMonitor, | |||
private val frameRateVitalMonitor: VitalMonitor, | |||
private val sessionEndedMetricDispatcher: SessionMetricDispatcher, | |||
private val sessionListener: RumSessionListener? | |||
private val sessionListener: RumSessionListener?, | |||
private val networkSettledResourceIdentifier: InitialResourceIdentifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
@@ -37,6 +38,7 @@ internal class RumSessionScope( | |||
frameRateVitalMonitor: VitalMonitor, | |||
private val sessionListener: RumSessionListener?, | |||
applicationDisplayed: Boolean, | |||
networkSettledResourceIdentifier: InitialResourceIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
@@ -40,6 +42,7 @@ internal class RumViewManagerScope( | |||
private val frameRateVitalMonitor: VitalMonitor, | |||
internal var applicationDisplayed: Boolean, | |||
internal val sampleRate: Float, | |||
internal val networkSettledResourceIdentifier: InitialResourceIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
@@ -62,8 +63,7 @@ internal open class RumViewScope( | |||
private val trackFrustrations: Boolean, | |||
internal val sampleRate: Float, | |||
private val interactionToNextViewMetricResolver: InteractionToNextViewMetricResolver, | |||
private val networkSettledMetricResolver: NetworkSettledMetricResolver = | |||
NetworkSettledMetricResolver(internalLogger = sdkCore.internalLogger) | |||
private val networkSettledMetricResolver: NetworkSettledMetricResolver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
@@ -70,7 +71,8 @@ internal class DatadogRumMonitor( | |||
memoryVitalMonitor: VitalMonitor, | |||
frameRateVitalMonitor: VitalMonitor, | |||
sessionListener: RumSessionListener, | |||
internal val executorService: ExecutorService | |||
internal val executorService: ExecutorService, | |||
internal val networkSettledResourceIdentifier: InitialResourceIdentifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Same, maybe we can rename this property to initialResourceIdentifier
.
What does this PR do?
Following the RFC we are introducing the
setNetworkSettledInitialResourceIdentifier
API as part of theRumConfiguration#Builder
in order to provide external control on which resource started in a view will be take partin the
time-to-network-settled
metric computation. The default identifier being used is aTimeBasedResourceIdentifier
with a default threshold set to100ms
. This could be re - used by our users in the ConfigurationBuilder
by changing thetime interval
to their internal needs.In addition to this this PR contain a small but very important fix in the
RumViewScope
where we make sure theNetworkSettledMetricResolver
is notified for theview stopped
only 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)