Rum-12060: Move RUM Debug Widget code from rum module to a new separate module#2960
Conversation
|
🎯 Code Coverage 🔗 Commit SHA: 429cca6 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## tvaleev/feature/innovation-week-07-04-25 #2960 +/- ##
============================================================================
+ Coverage 70.09% 70.14% +0.05%
============================================================================
Files 838 839 +1
Lines 30767 30770 +3
Branches 5231 5232 +1
============================================================================
+ Hits 21564 21581 +17
- Misses 7724 7731 +7
+ Partials 1479 1458 -21
🚀 New features to boost your workflow:
|
| It is intended for debugging and development purposes only and **should not** be included in production builds. | ||
| As shown in the screenshot below, the widget provides a floating overlay that displays key metrics such as **memory usage**, **CPU load** and **RUM events**. | ||
|
|
||
| <img src="../../docs/images/screenshot_rumdebugwidget.png" width="400" alt="Datadog RUM Debug Widget"/> No newline at end of file |
There was a problem hiding this comment.
minor: we should probably include details about the api call needed for integration
(.setInsightsCollector(DefaultInsightsCollector()))
There was a problem hiding this comment.
Good idea, yes. I think it's best to add it on RUM-12062 as the configuration will change there.
| /** | ||
| * The nullable singleton [InsightsCollector] instance. | ||
| */ | ||
| val insightsCollector: InsightsCollector? = (Datadog.getInstance() as? InternalSdkCore) |
There was a problem hiding this comment.
Question: This is a val in a singleton. If when first accessed the insightsCollector is null, will it recompute the instance when accessed again?
There was a problem hiding this comment.
It won't recompute. For that, we'd need to use a custom get(), should we do that?
| @InternalApi | ||
| @ExperimentalRumApi |
There was a problem hiding this comment.
If it is exposed as a part of public API, it shouldn't have @InternalApi annotation. Should it be a part of public API?
There was a problem hiding this comment.
Yes, as it's used in SampleApplication and intended to be used in the customers' applications in the future. Removed the @InternalApi notation.
|
|
||
| private var isPaused: Boolean = false | ||
|
|
||
| private val insightsCollector: DefaultInsightsCollector? |
There was a problem hiding this comment.
do we need a singleton if we are in the same module?
There was a problem hiding this comment.
This was the solution found for now, but it will be refactored and improved in RUM-12062.
There was a problem hiding this comment.
should this class be a part of public API?
There was a problem hiding this comment.
Yes for now, as it's being used in the Sample app's NavActivity and JetpackComposeActivity. After RUM-12062 this will be no longer needed so I intend to make it internal.
There was a problem hiding this comment.
If we are adding a new public module, it should be added to the publish jobs in CI.
There was a problem hiding this comment.
Added configuration for this module in default-pipeline.yml and local_ci.sh.
| * Provides the [InsightsCollector] instance inside the SDK, making it accessible to other modules. | ||
| */ | ||
| @InternalApi | ||
| object InsightsCollectorProvider { |
There was a problem hiding this comment.
Do we need this singleton? If yes, I guess it shouldn't be public?
There was a problem hiding this comment.
This was the solution found for now, but it will be refactored and improved in RUM-12062.
bcbb712
into
tvaleev/feature/innovation-week-07-04-25
What does this PR do?
dd-sdk-android-rumto a new moduledd-sdk-android-rum-debug-widget.LocalInsightsOverlay) and theInsightsCollectorinterface implementation (DefaultInsightsCollector) from the core RUM SDK.Motivation
InsightsCollectorimplementation.Review checklist (to be filled by reviewers)