dd-sdk-android
dd-sdk-android copied to clipboard
Live Profiling PoC
This pull request introduces several significant changes, primarily focusing on adding support for profiling and integrating Protobuf for enhanced functionality. The changes include introducing a new MergeTraceDumper class for profiling, updating the RUM feature to handle profiling and trace uploads, and integrating Protobuf into the build system. Below is a summary of the most important changes grouped by theme:
Profiling and Trace Management
-
Added
MergeTraceDumperclass: Introduced a singleton class for managing and merging profiling traces. It collects snapshots at regular intervals, merges them, and saves them as.pproffiles. The class is integrated into the RUM feature and theDdRumContentProviderto start and stop trace dumping. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/profiling/MergeTraceDumper.kt, features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/profiling/MergeTraceDumper.ktR1-R169) -
Updated
DdRumContentProvider: IntegratedMergeTraceDumperto start dumping traces during application startup. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/DdRumContentProvider.kt, [1] [2] -
Enhanced
RumMonitorandDatadogRumMonitor: AddedstartProfilingandstopProfilingmethods to manage profiling lifecycle. IntegratedMergeTraceDumperto stop dumping traces when the first view is started. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/RumMonitor.kt, [1];features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/monitor/DatadogRumMonitor.kt, [2] [3] [4]
Protobuf Integration
-
Integrated Protobuf into the build system: Added the Protobuf Gradle plugin, configured Protobuf source sets, and added dependencies for Protobuf. This enables the generation of Protobuf classes and their usage in the project. (
features/dd-sdk-android-rum/build.gradle.kts, [1] [2] [3] [4] -
Configured resource processing: Updated the build configuration to exclude duplicate resources during processing. (
features/dd-sdk-android-rum/build.gradle.kts, features/dd-sdk-android-rum/build.gradle.ktsR150-R152)
RUM Feature Enhancements
-
Added
MergedTracesUploader: Initialized in theRumFeatureclass to upload merged traces to the backend. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/RumFeature.kt, [1] [2] [3] -
Enhanced
RumViewScope: Added logic to send a custom "rum_app_launch" event when the app launch view is detected. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt, features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.ktR172-R180)
Other Changes
-
Made
CurlInterceptorpublic: Changed the visibility ofCurlInterceptorfrominternaltopublicfor broader usage. (dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/data/upload/CurlInterceptor.kt, dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/data/upload/CurlInterceptor.ktL24-R24) -
Removed
openmodifier fromRumViewScope: Simplified the class definition by making it non-open since no inheritance is required. (features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.kt, features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumViewScope.ktL56-R56)### What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)
- [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
- [ ] Make sure you discussed the feature or bugfix with the maintaining team in an Issue
- [ ] Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)