Skip to content

Conversation

@noahsmartin
Copy link
Contributor

@noahsmartin noahsmartin commented Oct 10, 2025

This moves SentryThreadInspector to a class so that it an be initialized from a Swift file. This is a prerequisite for #6274 because the FileIOTracker will also need to be initialized in Swift (and is dependent on SentryThreadInspector)

These need to be moved to the Swift file instead of SentryDependencies.m because in SPM you cannot have Swift code access a Swift type that is forward declared in an objc header. The FileIOTracker has this kind of usage - so it needs to be made accessible from somewhere other than the SentryDependencies.h header.

#skip-changelog

Closes #6406

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.776%. Comparing base (4267263) to head (79a3ac4).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6404       +/-   ##
=============================================
+ Coverage   86.706%   86.776%   +0.070%     
=============================================
  Files          439       440        +1     
  Lines        37243     37259       +16     
  Branches     17360     17370       +10     
=============================================
+ Hits         32292     32332       +40     
+ Misses        4908      4883       -25     
- Partials        43        44        +1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryANRTrackingIntegration.m 97.041% <ø> (-1.776%) ⬇️
Sources/Sentry/SentryDefaultThreadInspector.m 98.437% <ø> (ø)
Sources/Sentry/SentryDependencyContainer.m 89.711% <100.000%> (+0.153%) ⬆️
Sources/Sentry/SentryFileIOTracker.m 95.555% <100.000%> (ø)
...rces/Swift/SentryCrash/SentryThreadInspector.swift 100.000% <100.000%> (ø)

... and 17 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 4267263...79a3ac4. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1221.00 ms 1256.89 ms 35.89 ms
Size 23.75 KiB 989.12 KiB 965.38 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2481950 1221.04 ms 1248.98 ms 27.94 ms
3ffd0e5 1228.04 ms 1253.04 ms 25.00 ms
5cbd333 1219.93 ms 1241.76 ms 21.83 ms
5d238d3 1228.94 ms 1253.04 ms 24.10 ms
884b224 1221.11 ms 1255.88 ms 34.77 ms
7f2f69c 1237.61 ms 1266.96 ms 29.35 ms
1fecbb8 1242.78 ms 1265.40 ms 22.62 ms
a9fac2e 1212.45 ms 1219.67 ms 7.22 ms
ea5a59b 1222.87 ms 1253.47 ms 30.60 ms
934eee4 1222.51 ms 1251.04 ms 28.53 ms

App size

Revision Plain With Sentry Diff
2481950 23.74 KiB 872.74 KiB 849.00 KiB
3ffd0e5 23.75 KiB 947.55 KiB 923.80 KiB
5cbd333 23.74 KiB 969.77 KiB 946.02 KiB
5d238d3 23.75 KiB 913.62 KiB 889.88 KiB
884b224 23.75 KiB 879.55 KiB 855.80 KiB
7f2f69c 23.75 KiB 913.38 KiB 889.63 KiB
1fecbb8 23.75 KiB 969.28 KiB 945.53 KiB
a9fac2e 23.75 KiB 879.53 KiB 855.78 KiB
ea5a59b 23.75 KiB 874.46 KiB 850.71 KiB
934eee4 23.75 KiB 988.03 KiB 964.28 KiB

Previous results on branch: moveThreadInspectorToSwift

Startup times

Revision Plain With Sentry Diff
929cddd 1221.74 ms 1253.42 ms 31.68 ms
5034784 1233.00 ms 1267.43 ms 34.43 ms
c18d93a 1231.79 ms 1259.90 ms 28.12 ms

App size

Revision Plain With Sentry Diff
929cddd 23.75 KiB 989.11 KiB 965.36 KiB
5034784 23.75 KiB 989.08 KiB 965.33 KiB
c18d93a 23.75 KiB 989.10 KiB 965.35 KiB

@noahsmartin noahsmartin force-pushed the moveThreadInspectorToSwift branch 2 times, most recently from 13cc05d to 72907a7 Compare October 10, 2025 18:12
@noahsmartin noahsmartin merged commit f9f21b2 into main Oct 10, 2025
205 of 210 checks passed
@noahsmartin noahsmartin deleted the moveThreadInspectorToSwift branch October 10, 2025 21:02
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.

ref: Move ThreadInspector initialization to Swift

3 participants