-
Notifications
You must be signed in to change notification settings - Fork 64
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-6033 Add telemetry and logs related with RumMonitor#addViewLoadigTime API #2267
RUM-6033 Add telemetry and logs related with RumMonitor#addViewLoadigTime API #2267
Conversation
72483f6
to
cd72d44
Compare
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.
I don't see rest of the API usage events such as TrackingConsent?
Are we generating them or not?
@@ -144,7 +145,24 @@ internal class RumViewManagerScope( | |||
val importanceForeground = ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND | |||
val isForegroundProcess = processFlag == importanceForeground | |||
|
|||
if (applicationDisplayed || !isForegroundProcess) { | |||
if (event is RumRawEvent.AddViewLoadingTime) { |
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.
/question
do you need to add checks like this in future if you any other usage telemetry like setTrackingConsent
?
if yes, then we should change it to more generic else these if-else will explode.
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.
not anticipating that but this whole part will need re - factory soon but not planned for now.
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.
a backlog item would be fine here so we don't forget.
...dk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt
Show resolved
Hide resolved
...-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandler.kt
Show resolved
Hide resolved
cd72d44
to
e70c3ea
Compare
This PR is not about the |
*/ | ||
@InternalApi | ||
fun logApiUsage( | ||
apiUsageEvent: InternalTelemetryEvent.ApiUsage, | ||
samplingRate: Float | ||
samplingRate: Float = 15f |
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
Nitpick, this should be a constant and not a hardcoded Magic Number
@@ -144,7 +145,24 @@ internal class RumViewManagerScope( | |||
val importanceForeground = ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND | |||
val isForegroundProcess = processFlag == importanceForeground | |||
|
|||
if (applicationDisplayed || !isForegroundProcess) { | |||
if (event is RumRawEvent.AddViewLoadingTime) { |
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.
a backlog item would be fine here so we don't forget.
e70c3ea
to
23e11c2
Compare
@@ -748,6 +750,110 @@ internal class RumEventSerializerTest { | |||
} | |||
} | |||
|
|||
@RepeatedTest(8) |
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.
we should use @Test
to reduce CI load after making repeating test in local.
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.
in this case we need a repeated test as this model has multiple variables variation. Is good to have repetitive tests in order to make sure we cover more cases in this variation.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2267 +/- ##
===========================================
+ Coverage 69.91% 70.10% +0.19%
===========================================
Files 727 727
Lines 27112 27134 +22
Branches 4572 4570 -2
===========================================
+ Hits 18954 19021 +67
+ Misses 6872 6831 -41
+ Partials 1286 1282 -4
|
What does this PR do?
Following the RFC in this PR we are adding the logs and telemetry related with usage of the
RumMonitor#addViewLoadingTime
newly introduced API. The telemetry and log configuration will be configured accordingly with the current RUM context state and will help us understand what is the pattern for this API usage on the client side.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)