-
Notifications
You must be signed in to change notification settings - Fork 54
[RUM-14275] Enable Jank Stats Tracking on Android #1124
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-14275] Enable Jank Stats Tracking on Android #1124
Conversation
a9b1873 to
ce2a2ef
Compare
| telemetrySampleRate: 100, | ||
| } | ||
| }, | ||
| logsConfiguration: {}, |
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.
These were missing from the example app.
| nativeInitialization.initialize(ddSdkConfiguration) | ||
|
|
||
| val activity = reactContext.currentActivity; | ||
| if (ddSdkConfiguration.rumConfiguration != null && activity != null) { |
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.
Just to better understand. Is it possible that Activity is actually null here? Or currentActivity is just nullable in ReactContext and in the real life we will never see null here?
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 think it's possible for the Activity to be null at this point, but as you mentioned, since it is nullable we need to be overly cautious.
Also, the first check is there to avoid enabling this if RUM is not enabled.
packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt
Outdated
Show resolved
Hide resolved
ce2a2ef to
022c4da
Compare
What does this PR do?
refresh_rate_averagewas not being reported on Android apps.On React Native, by the time the SDK initializes and registers lifecycle callbacks, the initial Activity has already passed through onCreate() and onStart(). The native SDK's FrameStatesAggregator never receives onActivityStarted() for this activity, so JankStats is never initialized for the main window, and
@view.refresh_rate_averageis never collected.Motivation
Metrics should be properly reported.
Additional Notes
Before

After

Review checklist (to be filled by reviewers)