Skip to content
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-4720] Improve JS Refresh Rate reliability on Android #689

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

marco-saia-datadog
Copy link
Member

@marco-saia-datadog marco-saia-datadog commented Jul 8, 2024

What does this PR do?

Improves JS Refresh Rate reliability.

The previous implementation registered the VitalFrameCallback during the SDK initialisation, and did not account for the lifecycle of the app.

The new implementation stops the callback when the app is paused, resetting the last registered frame time, therefore avoiding false spikes in the framerate when the app goes to the background.

Additional Notes

  • The new implementation uses ChoreographerCompat instead of Choreographer for better compatibility, and it also makes sure the Choregrapher calls are performed on the UI Thread.

  • A UIThreadExecutor constructor parameter in DdSdkImplementation has also been introduced, in order to be able to inject a class to test UI Thread code correctly in the test environment.

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

@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-4720/js-fps-provider branch 3 times, most recently from be526a0 to b6888ec Compare July 16, 2024 13:00
@marco-saia-datadog marco-saia-datadog marked this pull request as ready for review July 16, 2024 13:01
@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner July 16, 2024 13:01
@marco-saia-datadog marco-saia-datadog force-pushed the marcosaia/RUM-4720/js-fps-provider branch 2 times, most recently from d8ddbbe to 90d50ac Compare July 16, 2024 15:04
@marco-saia-datadog marco-saia-datadog merged commit 6d7b1a9 into develop Jul 17, 2024
6 checks passed
@marco-saia-datadog marco-saia-datadog deleted the marcosaia/RUM-4720/js-fps-provider branch July 17, 2024 09:05
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