-
Notifications
You must be signed in to change notification settings - Fork 63
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-2687 Invert frame time to get js refresh rate #1105
RUMM-2687 Invert frame time to get js refresh rate #1105
Conversation
|
||
private fun VitalInfo.toInversePerformanceMetric(): ViewEvent.FlutterBuildTime { | ||
return ViewEvent.FlutterBuildTime( | ||
min = invertValue(maxValue), |
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.
why are you switching min
with max
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.
Maybe a comment to explain that would be nice here. It will be very hard to remember why we are doing this.
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'll add a comment indeed.
If we take the inverse of numbers, min and max are reversed.
For instance if min = 4
and max = 10
, then for the inverse min = 1/max = 0.1
and max = 1/min = 0.25
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 got that...what is hard for me to understand is that right now we are inverting the max
value to create the min
. But is this relevant ?
Codecov Report
@@ Coverage Diff @@
## develop #1105 +/- ##
===========================================
- Coverage 83.29% 83.25% -0.03%
===========================================
Files 273 273
Lines 9363 9368 +5
Branches 1503 1504 +1
===========================================
+ Hits 7798 7799 +1
- Misses 1147 1149 +2
- Partials 418 420 +2
|
5191821
to
bc37e69
Compare
c0402b7
to
79c3f51
Compare
What does this PR do?
Let the RN SDK report the frame time, then invert it when reporting to backend to report frame rate.
Motivation
Get a more sensible for the average js refresh rate by getting the harmonic mean instead of the arithmetic mean.
See https://gamedev.net/forums/topic/628085-math-fail-adding-frames-per-second/4960225/ and https://en.wikipedia.org/wiki/Harmonic_mean#Average_speed to understand why this makes more sense.
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)