-
-
Notifications
You must be signed in to change notification settings - Fork 377
chore: Convert SentryFramesTrackingIntegration to Swift
#7044
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
Merged
itaybre
merged 12 commits into
main
from
itay/cocoa-999-refactor-sentryframestrackingintegrationm-in-swift
Jan 16, 2026
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8ec937e
chore: Convert `SentryFramesTrackingIntegration` to Swift
itaybre bafb623
Update sdk_api.json
itaybre 37d602e
Fix `SentrySwiftIntegrationInstallerTests` tests
itaybre 1437985
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre 6985a35
Remove Hybrid SDK import
itaybre f09049f
Move `FramesTrackingProvider` to SentryDependencyContainer.swift
itaybre dcf1273
Remove deprecated checks for enabling FramesTrackingIntegration in Se…
itaybre 3b0e020
Remove swift5.9 check
itaybre 9a6b315
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre 39337c0
Remove header import
itaybre fb98b73
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre 69f0746
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Sources/Swift/Integrations/Performance/FramesTracking/SentryFramesTrackingIntegration.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| @_implementationOnly import _SentryPrivate | ||
|
|
||
| #if (os(iOS) || os(tvOS) || os(visionOS)) && !SENTRY_NO_UIKIT | ||
|
|
||
| final class SentryFramesTrackingIntegration<Dependencies: FramesTrackingProvider>: NSObject, SwiftIntegration { | ||
| let tracker: SentryFramesTracker | ||
|
|
||
| init?(with options: Options, dependencies: Dependencies) { | ||
| // Check hybrid SDK mode first - if enabled, always start frames tracking | ||
| if !PrivateSentrySDKOnly.framesTrackingMeasurementHybridSDKMode { | ||
itaybre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Check if frames tracking should be enabled based on options | ||
| let performanceDisabled = !options.enableAutoPerformanceTracing || !options.isTracingEnabled | ||
| let appHangsDisabled = options.isAppHangTrackingDisabled() | ||
| let watchdogDisabled = !options.enableWatchdogTerminationTracking | ||
|
|
||
| // The watchdog tracker uses the frames tracker, so frame tracking | ||
| // must be enabled if watchdog tracking is enabled. | ||
| if performanceDisabled && appHangsDisabled && watchdogDisabled { | ||
| if appHangsDisabled { | ||
| SentrySDKLog.debug("Not going to enable \(Self.name) because enableAppHangTracking is disabled or the appHangTimeoutInterval is 0.") | ||
| } | ||
|
|
||
| if performanceDisabled { | ||
| SentrySDKLog.debug("Not going to enable \(Self.name) because enableAutoPerformanceTracing and isTracingEnabled are disabled.") | ||
| } | ||
|
|
||
| if watchdogDisabled { | ||
| SentrySDKLog.debug("Not going to enable \(Self.name) because enableWatchdogTerminationTracking is disabled.") | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
| } | ||
|
|
||
| tracker = dependencies.framesTracker | ||
| tracker.start() | ||
| } | ||
|
|
||
| func uninstall() { | ||
| tracker.stop() | ||
| } | ||
|
|
||
| static var name: String { | ||
| "SentryFramesTrackingIntegration" | ||
| } | ||
| } | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.