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

impr: Capture transactions on a bg thread #3892

Merged
merged 5 commits into from
Apr 29, 2024

Conversation

philipphofmann
Copy link
Member

📜 Description

Instead of capturing and serializing the transaction on the calling thread, the SDK now does this on a background thread.

💡 Motivation and Context

Fixes GH-3826

💚 How did you test it?

Unit tests.

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Instead of capturing and serializing the transaction on the calling
thread, the SDK now does this on a background thread.

Fixes GH-3826
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 96.77419% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 90.652%. Comparing base (c8dbe73) to head (e71323a).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3892       +/-   ##
=============================================
+ Coverage   90.619%   90.652%   +0.033%     
=============================================
  Files          582       582               
  Lines        45467     45479       +12     
  Branches     16189     16203       +14     
=============================================
+ Hits         41202     41228       +26     
+ Misses        4195      4181       -14     
  Partials        70        70               
Files Coverage Δ
Sources/Sentry/SentryHub.m 98.554% <100.000%> (+0.021%) ⬆️
...tegrations/Session/SentrySessionTrackerTests.swift 98.347% <100.000%> (ø)
...s/SentryWatchdogTerminationsIntegrationTests.swift 96.969% <100.000%> (ø)
...tions/SentryWatchdogTerminationsTrackerTests.swift 98.689% <100.000%> (ø)
Tests/SentryTests/SentryHubTests.swift 98.850% <100.000%> (+0.010%) ⬆️
...ts/SentryTests/SentrySDKIntegrationTestsBase.swift 43.076% <100.000%> (ø)
Tests/SentryTests/SentrySDKTests.swift 95.010% <100.000%> (ø)
Tests/SentryTests/State/TestHub.swift 60.869% <100.000%> (ø)
...ests/SentryTests/Transaction/SentrySpanTests.swift 100.000% <100.000%> (ø)
...grations/Session/SentrySessionGeneratorTests.swift 0.000% <0.000%> (ø)

... and 7 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 c8dbe73...e71323a. Read the comment docs.

Copy link

github-actions bot commented Apr 24, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1233.39 ms 1254.51 ms 21.12 ms
Size 21.58 KiB 616.35 KiB 594.77 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3437454 1225.64 ms 1234.31 ms 8.67 ms
dd0557f 1246.31 ms 1258.46 ms 12.15 ms
9454d5d 1230.55 ms 1243.42 ms 12.87 ms
89bc37d 1240.76 ms 1248.24 ms 7.48 ms
742d4b6 1204.00 ms 1217.90 ms 13.90 ms
15cf6bf 1241.06 ms 1248.18 ms 7.12 ms
1bd0055 1207.57 ms 1223.10 ms 15.53 ms
734d507 1201.78 ms 1213.96 ms 12.18 ms
704d854 1219.82 ms 1243.69 ms 23.87 ms
e070f8a 1236.47 ms 1250.50 ms 14.03 ms

App size

Revision Plain With Sentry Diff
3437454 22.85 KiB 408.87 KiB 386.02 KiB
dd0557f 22.85 KiB 411.75 KiB 388.90 KiB
9454d5d 20.76 KiB 436.29 KiB 415.53 KiB
89bc37d 20.76 KiB 401.53 KiB 380.77 KiB
742d4b6 21.58 KiB 546.20 KiB 524.61 KiB
15cf6bf 22.85 KiB 405.38 KiB 382.53 KiB
1bd0055 20.76 KiB 420.22 KiB 399.46 KiB
734d507 22.85 KiB 412.66 KiB 389.81 KiB
704d854 21.58 KiB 615.98 KiB 594.40 KiB
e070f8a 21.58 KiB 546.20 KiB 524.62 KiB

Previous results on branch: impr/capture-transaction-on-bg-thread

Startup times

Revision Plain With Sentry Diff
f0c3f1f 1230.56 ms 1247.35 ms 16.78 ms

App size

Revision Plain With Sentry Diff
f0c3f1f 21.58 KiB 615.15 KiB 593.57 KiB

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

@philipphofmann philipphofmann merged commit 38b36f5 into main Apr 29, 2024
70 checks passed
@philipphofmann philipphofmann deleted the impr/capture-transaction-on-bg-thread branch April 29, 2024 09:06
dKasabwala pushed a commit to dKasabwala/sentry-cocoa that referenced this pull request May 6, 2024
Instead of capturing and serializing the transaction on the calling
thread, the SDK now does this on a background thread.

Fixes getsentryGH-3826
threema-matteo pushed a commit to threema-ch/sentry-cocoa that referenced this pull request May 21, 2024
Instead of capturing and serializing the transaction on the calling
thread, the SDK now does this on a background thread.

Fixes getsentryGH-3826
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.

Consider serializing transactions on a background thread
3 participants