-
Notifications
You must be signed in to change notification settings - Fork 76
RUM-10907: Support process_uptime attribute for telemetry debug/error events
#3013
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
base: develop
Are you sure you want to change the base?
Conversation
dd-sdk-android-core/src/main/kotlin/com/datadog/android/api/context/TimeInfo.kt
Outdated
Show resolved
Hide resolved
dd-sdk-android-core/src/main/kotlin/com/datadog/android/api/context/TimeInfo.kt
Outdated
Show resolved
Hide resolved
| * @property deviceTimeSinceProcessStartMs the time spend since application's process start (for Android SDK >= 24) or | ||
| * between the class being loaded for Android < N as a fallback. |
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'm curious if it is fine to have a different behavior for the same property. Maybe it is worth to make this property nullable and return null for API 23? And then it will be up to the caller what to do.
Otherwise we may see inconsistent data if the result of this property is used in some data we send.
WDYT?
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.
Well I was trying to find a balance between support complexity and value it provides:
getStartElapsedRealtimeis supported from the version 24 of Android SDK, currentminSdkis 23. So the amount of such devices is relatively small.- This attribute represents the amount of time spend from some moment in the past and represents relativity, not the actual time, from that perspective seems like there no so big difference from which point it would be calculated as the point remains the same for each device.
- After @aleksandr-gringauz's suggestion, I changed logic to use
AppStartTimeProviderso the value will be more even precise
dd-sdk-android-internal/src/main/java/com/datadog/android/internal/time/TimeProvider.kt
Outdated
Show resolved
Hide resolved
dd-sdk-android-internal/src/main/java/com/datadog/android/internal/time/TimeProvider.kt
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3013 +/- ##
===========================================
- Coverage 71.32% 71.13% -0.19%
===========================================
Files 859 861 +2
Lines 31315 31308 -7
Branches 5276 5276
===========================================
- Hits 22334 22268 -66
- Misses 7511 7534 +23
- Partials 1470 1506 +36
🚀 New features to boost your workflow:
|
251e297 to
97946d9
Compare
...d-core/src/main/kotlin/com/datadog/android/core/internal/time/DefaultAppStartTimeProvider.kt
Outdated
Show resolved
Hide resolved
97946d9 to
2633d21
Compare
| * The offsets are always 0. | ||
| */ | ||
| class DefaultTimeProvider : TimeProvider { | ||
| override fun getDeviceTimestamp(): Long = System.currentTimeMillis() |
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.
is this change needed?
What does this PR do?
TimeProviderallowing to get the amount of time (in milliseconds) since process start. The api for that was added only for Android SDK 24, so for previous versions class load time gonna be used.TimeInfoinstance creation.Review checklist (to be filled by reviewers)