Skip to content

RUM-11831: Integrate Perfetto ProfilingManager API#2902

Merged
ambushwork merged 1 commit into
feature/perfetto-profilingfrom
yl/profiling/add-perfetto-api
Oct 1, 2025
Merged

RUM-11831: Integrate Perfetto ProfilingManager API#2902
ambushwork merged 1 commit into
feature/perfetto-profilingfrom
yl/profiling/add-perfetto-api

Conversation

@ambushwork

@ambushwork ambushwork commented Sep 29, 2025

Copy link
Copy Markdown
Member

What does this PR do?

This PR creates PerfettoProfiler to delegate Perfetto ProfilingManager API:

  • Expose start and stop to internal module to start and stop profiling
  • Send telemetry when start and stop

Motivation

RUM-11831

Additional Notes

  • Add TimeProvider Interface and default implementation in internal module since we need it in PerfettoProfiler
  • To use Profiling API, we need to upgrade androidx.core version to 1.17.0 which deprecates GestureDetectorCompat in RUM GesturesDetectorWrapper, but we Suppress it in this PR.

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)

@ambushwork
ambushwork force-pushed the yl/profiling/add-perfetto-api branch 11 times, most recently from dd8c48f to cb42528 Compare September 30, 2025 11:42
@codecov-commenter

codecov-commenter commented Sep 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.01%. Comparing base (5357261) to head (b5724e3).
⚠️ Report is 995 commits behind head on feature/perfetto-profiling.

Files with missing lines Patch % Lines
...dog/android/profiling/internal/PerfettoProfiler.kt 95.56% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/perfetto-profiling    #2902      +/-   ##
==============================================================
+ Coverage                       70.93%   71.01%   +0.07%     
==============================================================
  Files                             816      817       +1     
  Lines                           30014    30059      +45     
  Branches                         5022     5024       +2     
==============================================================
+ Hits                            21290    21344      +54     
+ Misses                           7336     7335       -1     
+ Partials                         1388     1380       -8     
Files with missing lines Coverage Δ
...nstrumentation/gestures/GesturesDetectorWrapper.kt 70.00% <ø> (ø)
...dog/android/profiling/internal/PerfettoProfiler.kt 95.56% <95.56%> (ø)

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ambushwork
ambushwork marked this pull request as ready for review September 30, 2025 12:39
@ambushwork
ambushwork requested review from a team as code owners September 30, 2025 12:39

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

* Provides the current device timestamp.
* Meant for internal usage.
*/
interface TimeProvider {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have com.datadog.android.core.internal.time.TimeProvider and also com.datadog.android.sessionreplay.internal.utils.TimeProvider.

Maybe it is worth to simply pull the one from core to internal? Otherwise we have 3 TimeProvider interfaces.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased the branch and replaced it with the new merged TimeProvider in internal

Comment thread detekt_custom_safe_calls.yml
private val timeProvider: TimeProvider
) : Profiler {

private val profilingExecutor = Executors.newSingleThreadExecutor()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth to pull it to the constructor to be able to inject the "same-thread" executor for tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@ambushwork
ambushwork force-pushed the yl/profiling/add-perfetto-api branch 3 times, most recently from 725d436 to 40cd5ac Compare October 1, 2025 09:45
@ambushwork
ambushwork force-pushed the yl/profiling/add-perfetto-api branch from 40cd5ac to b5724e3 Compare October 1, 2025 10:00
@ambushwork
ambushwork merged commit 7020f11 into feature/perfetto-profiling Oct 1, 2025
25 checks passed
@ambushwork
ambushwork deleted the yl/profiling/add-perfetto-api branch October 1, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants