Skip to content

Rebuild profiling request for every profiling start#3076

Merged
ambushwork merged 1 commit intofeature/perfetto-profilingfrom
yl/profiling/support-multi-request
Dec 26, 2025
Merged

Rebuild profiling request for every profiling start#3076
ambushwork merged 1 commit intofeature/perfetto-profilingfrom
yl/profiling/support-multi-request

Conversation

@ambushwork
Copy link
Copy Markdown
Member

@ambushwork ambushwork commented Dec 24, 2025

What does this PR do?

Prior to this PR, in PerfettoProfile the cancel signal and profiling request are created only when the class is initialized (not recreated if the start is called for another time), which causes the following request can't be cancelled, because the original cancel signal is already cancelled before thus in a "cancelled" state.

Motivation

This changes will be necessary to support multiple profiling request in the future.

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 marked this pull request as ready for review December 24, 2025 15:03
@ambushwork ambushwork requested a review from a team as a code owner December 24, 2025 15:03
@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Dec 24, 2025

🎯 Code Coverage
Patch Coverage: 93.75%
Overall Coverage: 66.42% (+0.02%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b9ae78a | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.33%. Comparing base (4f0483e) to head (b9ae78a).
⚠️ Report is 2 commits behind head on feature/perfetto-profiling.

Files with missing lines Patch % Lines
...id/profiling/internal/perfetto/PerfettoProfiler.kt 92.31% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/perfetto-profiling    #3076      +/-   ##
==============================================================
+ Coverage                       71.28%   71.33%   +0.05%     
==============================================================
  Files                             893      893              
  Lines                           32689    32694       +5     
  Branches                         5493     5495       +2     
==============================================================
+ Hits                            23302    23321      +19     
+ Misses                           7827     7817      -10     
+ Partials                         1560     1556       -4     
Files with missing lines Coverage Δ
...id/profiling/internal/perfetto/PerfettoProfiler.kt 92.06% <92.31%> (-2.76%) ⬇️

... and 38 files with indirect coverage changes

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

0xnm
0xnm previously approved these changes Dec 24, 2025
@ambushwork ambushwork force-pushed the yl/profiling/support-multi-request branch from d0753d4 to b9ae78a Compare December 24, 2025 16:02
@ambushwork ambushwork requested a review from 0xnm December 24, 2025 16:03

@Test
fun `M not have the same stop signal W start&stop multiple times`() {
inOrder(mockService) {
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.

I think it is better just to have 2 inOrder(...) { } invocations local to the corresponding // Then sections, rather than wrap the whole test in it.

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.

It doesn't seem to work, if I break it down into two inOrder block, the second block in not able to know the previous call is verified, and throw error "Wanted 1 time, But was 2 times"

any<String>(),
stopSignalCaptor.capture(),
any(),
callbackCaptor.capture()
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.

Suggested change
callbackCaptor.capture()
any()

captured value is not read anyway

@ambushwork ambushwork merged commit f69769c into feature/perfetto-profiling Dec 26, 2025
26 checks passed
@ambushwork ambushwork deleted the yl/profiling/support-multi-request branch December 26, 2025 10:58
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.

3 participants