-
Notifications
You must be signed in to change notification settings - Fork 133
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
RUMM-1278 Screen Refresh Rate vitals #522
Conversation
5d0c775
to
3be6499
Compare
5c0916d
to
6772478
Compare
6772478
to
67f4237
Compare
Tests/DatadogTests/Datadog/RUM/RUMVitals/VitalRefreshRateReaderTests.swift
Outdated
Show resolved
Hide resolved
8bf3f03
to
c7f0310
Compare
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 left thread synchronization question as IMO there is an unnecessary penalty on the main thread and I don't clearly see how we will further read these value form secondary thread in RUM scope.
@xgouchet how do you synchronize publishing this vital from main
thread and reading it from RUM scope
thread on Android?
On Android the RUM View Scope doesn't read from it. What happens is the view gets notified when a new aggregation is available and stores its value locally, and when it sends the event it sends it with the latest local value it knows |
Tests/DatadogTests/Datadog/RUM/RUMVitals/VitalRefreshRateReaderTests.swift
Show resolved
Hide resolved
After blocking UI thread, we must wait a bit in order for the reader to read once again before assertions
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.
Looks very good 👌
What and why?
We will be reading the refresh rate during app's lifetime in order to detect UI hitches.
How?
iOS renders UI in the main run loop, this is a
RunLoop
instance. We want to be notified when a new frame is drawn.CADisplayLink
is a special timer type which listens to frame paints in a given run loop.We add a
CADisplayLink
instance toRunLoop.main
so that it calls our method every time a new frame is drawn.Review checklist