Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(profiling): new launch profiling option #4981

Open
wants to merge 36 commits into
base: armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch
Choose a base branch
from

Conversation

armcknight
Copy link
Member

@armcknight armcknight commented Mar 14, 2025

Introduce the new SentryProfileOptions.profileAppStarts option.

I realized I would need to be able to distinguish between continuous profiling V1 with launch profiling enabled and this V2 launch profiling, so I had to rework the way SentryProfileOptions are configured in SentryOptions, so I used a configuration block pattern similar to user feedback and replay, so that I could look for the presence of the configuration by nilchecking it.

Note that while the diff size on this is large, almost all of it is test code.

#skip-changelog; for #4853

Copy link

github-actions bot commented Mar 14, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 4fd672c

Copy link

codecov bot commented Mar 14, 2025

Codecov Report

Attention: Patch coverage is 93.90126% with 63 lines in your changes missing coverage. Please review.

Project coverage is 92.731%. Comparing base (5f1bcd4) to head (4fd672c).

Files with missing lines Patch % Lines
...ts/SentryAppStartProfilingConfigurationTests.swift 72.826% 25 Missing ⚠️
Sources/Sentry/Profiling/SentryLaunchProfiling.m 91.791% 11 Missing ⚠️
...entry/Profiling/SentryProfiledTracerConcurrency.mm 80.357% 11 Missing ⚠️
Sources/Sentry/SentryProfiler.mm 81.632% 9 Missing ⚠️
Sources/Sentry/SentrySDK.m 88.888% 3 Missing ⚠️
...yProfilerTests/SentryProfilingPublicAPITests.swift 99.082% 2 Missing ⚠️
Sources/Sentry/PrivateSentrySDKOnly.mm 0.000% 1 Missing ⚠️
Sources/Sentry/include/SentryInternalDefines.h 0.000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                                           Coverage Diff                                           @@
##           armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch     #4981       +/-   ##
=======================================================================================================
- Coverage                                                             92.743%   92.731%   -0.012%     
=======================================================================================================
  Files                                                                    673       674        +1     
  Lines                                                                  82805     83510      +705     
  Branches                                                               30122     30434      +312     
=======================================================================================================
+ Hits                                                                   76796     77440      +644     
- Misses                                                                  5910      5973       +63     
+ Partials                                                                  99        97        -2     
Files with missing lines Coverage Δ
Sources/Sentry/Profiling/SentryTraceProfiler.mm 95.522% <100.000%> (ø)
Sources/Sentry/SentryFileManager.m 95.156% <ø> (ø)
Sources/Sentry/SentryOptions.m 98.576% <100.000%> (+0.015%) ⬆️
Sources/Sentry/SentrySessionTracker.m 98.979% <ø> (ø)
Sources/Sentry/SentryTimeToDisplayTracker.m 99.166% <100.000%> (-0.834%) ⬇️
Sources/Sentry/SentryTracer.m 98.049% <100.000%> (+0.536%) ⬆️
...ntegrations/Performance/SentryProfileOptions.swift 100.000% <100.000%> (ø)
...yProfilerTests/SentryAppLaunchProfilingTests.swift 100.000% <100.000%> (ø)
...yProfilerTests/SentryContinuousProfilerTests.swift 97.971% <ø> (-0.041%) ⬇️
...ts/SentryTests/Helper/SentryFileManagerTests.swift 96.714% <100.000%> (ø)
... and 8 more

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f1bcd4...4fd672c. Read the comment docs.

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

Copy link

github-actions bot commented Mar 14, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1204.85 ms 1236.35 ms 31.50 ms
Size 22.30 KiB 843.98 KiB 821.67 KiB

Baseline results on branch: armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch

Startup times

Revision Plain With Sentry Diff
11c45fa 1232.76 ms 1252.08 ms 19.32 ms
9667f56 1219.00 ms 1235.13 ms 16.13 ms
781bb09 1230.79 ms 1250.00 ms 19.21 ms
28931ab 1227.59 ms 1245.56 ms 17.97 ms
b87a934 1208.32 ms 1237.02 ms 28.70 ms
b81c36b 1229.65 ms 1252.16 ms 22.51 ms
346d3a3 1215.51 ms 1250.65 ms 35.14 ms
28250fc 1229.90 ms 1249.08 ms 19.18 ms
99dbffb 1229.43 ms 1250.16 ms 20.73 ms
d9789ac 1224.06 ms 1248.47 ms 24.41 ms

App size

Revision Plain With Sentry Diff
11c45fa 22.30 KiB 839.07 KiB 816.77 KiB
9667f56 22.30 KiB 829.36 KiB 807.06 KiB
781bb09 22.30 KiB 833.45 KiB 811.14 KiB
28931ab 22.30 KiB 840.17 KiB 817.86 KiB
b87a934 22.30 KiB 840.16 KiB 817.85 KiB
b81c36b 22.30 KiB 823.44 KiB 801.13 KiB
346d3a3 22.30 KiB 833.56 KiB 811.26 KiB
28250fc 22.30 KiB 829.69 KiB 807.39 KiB
99dbffb 22.30 KiB 840.17 KiB 817.86 KiB
d9789ac 22.30 KiB 823.68 KiB 801.38 KiB

Previous results on branch: armcknight/git-chain/profiling/new-continuous-apis/6-launch-profiling

Startup times

Revision Plain With Sentry Diff
9839a68 1228.24 ms 1247.98 ms 19.73 ms
cf7f7c2 1215.34 ms 1239.89 ms 24.55 ms
2fd0f0e 1225.94 ms 1247.47 ms 21.53 ms
0a0a2bf 1213.19 ms 1239.20 ms 26.01 ms
284b1c6 1245.83 ms 1264.37 ms 18.53 ms
4ab7fff 1200.92 ms 1220.73 ms 19.82 ms
4f73298 1211.70 ms 1234.02 ms 22.32 ms

App size

Revision Plain With Sentry Diff
9839a68 22.30 KiB 843.83 KiB 821.52 KiB
cf7f7c2 22.30 KiB 842.86 KiB 820.56 KiB
2fd0f0e 22.30 KiB 842.05 KiB 819.75 KiB
0a0a2bf 22.30 KiB 843.82 KiB 821.52 KiB
284b1c6 22.30 KiB 843.83 KiB 821.52 KiB
4ab7fff 22.30 KiB 843.09 KiB 820.78 KiB
4f73298 22.30 KiB 843.23 KiB 820.92 KiB

Base automatically changed from armcknight/git-chain/profiling/new-continuous-apis/5-refactor-tests to armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch March 18, 2025 07:22
@armcknight armcknight changed the base branch from armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch to armcknight/profiling/new-continuous-apis/fix-tests March 19, 2025 00:10
@armcknight armcknight marked this pull request as ready for review March 19, 2025 12:14
@armcknight armcknight marked this pull request as draft March 20, 2025 01:09
@armcknight armcknight changed the base branch from armcknight/profiling/new-continuous-apis/fix-tests to armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch March 21, 2025 06:36
@armcknight armcknight marked this pull request as ready for review March 21, 2025 06:37
@armcknight armcknight changed the base branch from armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch to armcknight/profiling/new-continuous-apis/fix-tests March 21, 2025 06:38
@armcknight armcknight force-pushed the armcknight/profiling/new-continuous-apis/fix-tests branch from 12b6b16 to c3c3cfd Compare March 21, 2025 06:57
@armcknight armcknight force-pushed the armcknight/git-chain/profiling/new-continuous-apis/6-launch-profiling branch from 7b6e093 to a65fcde Compare March 21, 2025 08:34
Base automatically changed from armcknight/profiling/new-continuous-apis/fix-tests to armcknight/git-chain/profiling/new-continuous-apis/0-topic-branch March 31, 2025 20:35
Copy link

github-actions bot commented Apr 1, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

Copy link
Contributor

@philprime philprime left a comment

Choose a reason for hiding this comment

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

Left some comments, and also it seems like compilation fails for some platform, but I couldn't directly comment it. Please see the test annotations

Copy link

github-actions bot commented Apr 1, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

…e out how to deal with the deprecated usage in SentryEnabledFeaturesBuilder"

This reverts commit dc0686f.
Copy link

github-actions bot commented Apr 1, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@armcknight
Copy link
Member Author

thanks @philprime for the review! addressed all your comments. as for the CI issues, i just merged in #5008 which fixed the remaining issue for it.

Copy link

github-actions bot commented Apr 1, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

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