-
Notifications
You must be signed in to change notification settings - Fork 61
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-3356 fix jankstats #1512
RUMM-3356 fix jankstats #1512
Conversation
719411f
to
627b446
Compare
627b446
to
492cbe8
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1512 +/- ##
===========================================
- Coverage 82.00% 81.96% -0.04%
===========================================
Files 363 364 +1
Lines 12981 13018 +37
Branches 2162 2168 +6
===========================================
+ Hits 10645 10670 +25
- Misses 1679 1685 +6
- Partials 657 663 +6
|
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.
nice work, thanks for the help! I added few comments/suggestions.
} | ||
|
||
@Test | ||
fun `𝕄 foNothing 𝕎 onActivityStopped() {}`() { |
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.
fun `𝕄 foNothing 𝕎 onActivityStopped() {}`() { | |
fun `𝕄 do nothing 𝕎 onActivityStopped() {}`() { |
detekt_custom.yml
Outdated
@@ -613,6 +613,7 @@ datadog: | |||
- "kotlin.collections.List.toSet()" | |||
- "kotlin.collections.List.withIndex()" | |||
- "kotlin.collections.Map.containsKey(kotlin.String)" | |||
- "kotlin.collections.MutableMap.containsKey(android.view.Window)" |
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.
probably should be placed below, around line 673.
InternalLogger.Target.MAINTAINER, | ||
"Disabling jankStats for window $window" | ||
) | ||
activeWindowsListener[window]?.isTrackingEnabled = false |
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'm wondering if we should use WeakHashMap
for activeActivities
and activeWindowsListener
, in case if the window was temporary and will be destroyed once a particular activity is destroyed.
I can see that PolicyManager.makeNewWindow
can be called from different places, Dialog
constructor included. So if there is a dialog shown and then destroyed, we will be keeping Window
instance in the memory forever, preventing it from be GCed.
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.
lgtm!
What does this PR do?
This PR aims at solving some issues found when using the JankStats tool to track Mobile Vitals
onActivityStarted()
: before that the window is not fully created and the JankStats creation would often failonActivityStopped()
to prevent keeping a listener on a Window not being used anymore.Additional Notes
Review checklist (to be filled by reviewers)