-
Notifications
You must be signed in to change notification settings - Fork 75
RUM-10363: Replace System static calls with TimeProvider #3011
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
Open
kikoveiga
wants to merge
4
commits into
develop
Choose a base branch
from
kikoveiga/RUM-10363/use-time-provider
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
🎯 Code Coverage 🔗 Commit SHA: fa401f1 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
d4a2312 to
3715bec
Compare
aleksandr-gringauz
previously approved these changes
Dec 16, 2025
Contributor
aleksandr-gringauz
left a comment
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.
Nice work!
...ore/src/test/kotlin/com/datadog/android/core/internal/data/upload/RotatingDnsResolverTest.kt
Show resolved
Hide resolved
tools/benchmark/src/main/java/com/datadog/benchmark/DatadogVitalsMeter.kt
Outdated
Show resolved
Hide resolved
0xnm
requested changes
Dec 16, 2025
Member
0xnm
left a comment
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 very briefly went through some files.
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
...d-core/src/main/kotlin/com/datadog/android/core/internal/time/DefaultAppStartTimeProvider.kt
Outdated
Show resolved
Hide resolved
...-core/src/test/kotlin/com/datadog/android/core/internal/metrics/MethodCalledTelemetryTest.kt
Show resolved
Hide resolved
3715bec to
5153c40
Compare
6c5ec4a to
d6bd044
Compare
0xnm
reviewed
Dec 17, 2025
...ore/src/test/kotlin/com/datadog/android/core/internal/data/upload/RotatingDnsResolverTest.kt
Outdated
Show resolved
Hide resolved
...ore/src/test/kotlin/com/datadog/android/core/internal/data/upload/RotatingDnsResolverTest.kt
Show resolved
Hide resolved
...om/datadog/android/core/internal/persistence/file/advanced/MoveDataMigrationOperationTest.kt
Outdated
Show resolved
Hide resolved
...om/datadog/android/core/internal/persistence/file/advanced/MoveDataMigrationOperationTest.kt
Outdated
Show resolved
Hide resolved
...om/datadog/android/core/internal/persistence/file/advanced/WipeDataMigrationOperationTest.kt
Show resolved
Hide resolved
...id-core/src/test/kotlin/com/datadog/android/utils/forge/BatchClosedMetadataForgeryFactory.kt
Show resolved
Hide resolved
...ndroid-logs/src/test/kotlin/com/datadog/android/log/internal/logger/DatadogLogHandlerTest.kt
Outdated
Show resolved
Hide resolved
...rc/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumContinuousActionScopeTest.kt
Outdated
Show resolved
Hide resolved
.../kotlin/com/datadog/android/sessionreplay/internal/resources/ResourceDataStoreManagerTest.kt
Show resolved
Hide resolved
54e7da2 to
5491a1b
Compare
0xnm
reviewed
Dec 23, 2025
...re/src/test/kotlin/com/datadog/android/core/internal/time/DefaultAppStartTimeProviderTest.kt
Show resolved
Hide resolved
...st/kotlin/com/datadog/android/rum/internal/instrumentation/MainLooperLongTaskStrategyTest.kt
Outdated
Show resolved
Hide resolved
fca49de to
75df8d5
Compare
a9e08d8 to
bf2f14c
Compare
bf2f14c to
fa401f1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
System.currentTimeMillis()andSystem.nanoTime()calls withTimeProviderinterface calls.Thread.sleepcalls with fake timestamps using amockTimeProvider.Motivation
Additional Notes
These are the results of running debug unit tests locally on develop and current branch, where there are noticeable time improvements.
Review checklist (to be filled by reviewers)