-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiling): change how continuous profiling is enabled (#4024)
- Loading branch information
1 parent
643853e
commit e70a2e1
Showing
22 changed files
with
385 additions
and
205 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -10,7 +10,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
|
||
static let defaultDSN = "https://[email protected]/5428557" | ||
|
||
//swiftlint:disable function_body_length | ||
//swiftlint:disable function_body_length cyclomatic_complexity | ||
static func startSentry() { | ||
|
||
// For testing purposes, we want to be able to change the DSN and store it to disk. In a real app, you shouldn't need this behavior. | ||
|
@@ -53,8 +53,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
} | ||
} | ||
|
||
var profilesSampleRate: NSNumber = 1 | ||
if let profilesSampleRateOverride = env["--io.sentry.profilesSampleRate"] { | ||
var profilesSampleRate: NSNumber? = 1 | ||
if args.contains("--io.sentry.enableContinuousProfiling") { | ||
profilesSampleRate = nil | ||
} else if let profilesSampleRateOverride = env["--io.sentry.profilesSampleRate"] { | ||
profilesSampleRate = NSNumber(value: (profilesSampleRateOverride as NSString).integerValue) | ||
} | ||
options.profilesSampleRate = profilesSampleRate | ||
|
@@ -81,7 +83,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
options.enableTimeToFullDisplayTracing = true | ||
options.enablePerformanceV2 = true | ||
options.enableMetrics = true | ||
options.enableContinuousProfiling = ProcessInfo.processInfo.arguments.contains("--io.sentry.enable-continuous-profiling") | ||
|
||
options.add(inAppInclude: "iOS_External") | ||
|
||
|
@@ -146,7 +147,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
SentrySDK.metrics.increment(key: "app.start", value: 1.0, tags: ["view": "app-delegate"]) | ||
|
||
} | ||
//swiftlint:enable function_body_length | ||
//swiftlint:enable function_body_length cyclomatic_complexity | ||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
|
||
|
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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,12 @@ | ||
#import "SentrySpan.h" | ||
|
||
#import "SentryProfilingConditionals.h" | ||
|
||
@interface | ||
SentrySpan () | ||
|
||
#if SENTRY_TARGET_PROFILING_SUPPORTED | ||
@property (copy, nonatomic) NSString *_Nullable profileSessionID; | ||
#endif // SENTRY_TARGET_PROFILING_SUPPORTED | ||
|
||
@end |
This file contains 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.