Skip to content

[RUM-14275] Enable Jank Stats Tracking on Android#1124

Merged
sbarrio merged 1 commit intodevelopfrom
sbarrio/fix/refresh-rate-average-missing-on-android
Feb 6, 2026
Merged

[RUM-14275] Enable Jank Stats Tracking on Android#1124
sbarrio merged 1 commit intodevelopfrom
sbarrio/fix/refresh-rate-average-missing-on-android

Conversation

@sbarrio
Copy link
Contributor

@sbarrio sbarrio commented Feb 5, 2026

What does this PR do?

refresh_rate_average was 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_average is never collected.

Motivation

Metrics should be properly reported.

Additional Notes

Before
Screenshot 2026-02-05 at 10 35 50

After
Screenshot 2026-02-05 at 11 12 25

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@sbarrio sbarrio requested a review from a team as a code owner February 5, 2026 10:29
@sbarrio sbarrio marked this pull request as draft February 5, 2026 10:31
@sbarrio sbarrio force-pushed the sbarrio/fix/refresh-rate-average-missing-on-android branch 2 times, most recently from a9b1873 to ce2a2ef Compare February 5, 2026 10:42
telemetrySampleRate: 100,
}
},
logsConfiguration: {},
Copy link
Contributor Author

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.

@sbarrio sbarrio marked this pull request as ready for review February 5, 2026 10:42
@sbarrio sbarrio self-assigned this Feb 5, 2026
nativeInitialization.initialize(ddSdkConfiguration)

val activity = reactContext.currentActivity;
if (ddSdkConfiguration.rumConfiguration != null && activity != null) {
Copy link

@aleksandr-gringauz aleksandr-gringauz Feb 5, 2026

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?

Copy link
Contributor Author

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.

@sbarrio sbarrio force-pushed the sbarrio/fix/refresh-rate-average-missing-on-android branch from ce2a2ef to 022c4da Compare February 5, 2026 16:04
@sbarrio sbarrio merged commit c02af9d into develop Feb 6, 2026
11 checks passed
@sbarrio sbarrio deleted the sbarrio/fix/refresh-rate-average-missing-on-android branch February 6, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants