[RUM-8875] Add ability to manually add an activity to JankStats#2524
Merged
Conversation
fuzzybinary
force-pushed
the
jward/RUM-8875-manual-jank-stats-add
branch
from
March 5, 2025 14:38
5afa3fb to
e36ff19
Compare
Unity's main activity is started prior to initializing Datadog, so it misses adding the Activity to JankStats tracking. Add an internal method to allow manually adding an activity to JankStats tracking.
fuzzybinary
force-pushed
the
jward/RUM-8875-manual-jank-stats-add
branch
from
March 5, 2025 14:59
e36ff19 to
231e760
Compare
0xnm
reviewed
Mar 5, 2025
Comment on lines
+389
to
+398
| try { | ||
| jankStatsActivityLifecycleListener?.onActivityStarted(activity) | ||
| } catch (@Suppress("TooGenericExceptionCaught") e: Exception) { | ||
| sdkCore.internalLogger.log( | ||
| InternalLogger.Level.ERROR, | ||
| InternalLogger.Target.TELEMETRY, | ||
| { FAILED_TO_ENABLE_JANK_STATS_TRACKING_MANUALLY }, | ||
| e | ||
| ) | ||
| } |
Member
There was a problem hiding this comment.
which exception do we expect here? or it is just a generic safeguard, just in case?
Member
Author
There was a problem hiding this comment.
Generic safeguard. Detekt complained about it, and instead of suppressing it I thought it would be better to catch and log.
Member
Author
There was a problem hiding this comment.
To be clearer, Detekt complained about onActivityStarted being unsafe.
0xnm
previously approved these changes
Mar 5, 2025
Co-authored-by: Nikita Ogorodnikov <[email protected]>
fuzzybinary
force-pushed
the
jward/RUM-8875-manual-jank-stats-add
branch
from
March 5, 2025 19:28
3187ddf to
bdddd22
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2524 +/- ##
===========================================
- Coverage 70.09% 70.08% -0.01%
===========================================
Files 796 796
Lines 29957 29972 +15
Branches 5012 5013 +1
===========================================
+ Hits 20997 21004 +7
- Misses 7569 7583 +14
+ Partials 1391 1385 -6
🚀 New features to boost your workflow:
|
0xnm
approved these changes
Mar 6, 2025
jonathanmos
approved these changes
Mar 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a method to
AdvancedRumMonitorto manually add an activity to JankStats tracking so that we can get framerate information.Motivation
Unity's main activity is started prior to initializing Datadog, so it misses adding the Activity to JankStats tracking.
Review checklist (to be filled by reviewers)