@@ -42,7 +42,7 @@ class InstanaConfiguration {
4242 static let all : Set < MonitorTypes > = [ . http,
4343 . memoryWarning,
4444 . framerateDrop( frameThreshold: 20 ) ,
45- . alertApplicationNotResponding( threshold: 2 .0) ]
45+ . alertApplicationNotResponding( threshold: 3 .0) ]
4646 }
4747
4848 struct Defaults {
@@ -82,11 +82,16 @@ class InstanaConfiguration {
8282 slowSendInterval: Instana . Types . Seconds ,
8383 usiRefreshTimeIntervalInHrs: Double ,
8484 hybridAgentId: String ? ,
85- hybridAgentVersion: String ? ) {
85+ hybridAgentVersion: String ? ,
86+ anrThreshold: Instana . Types . Milliseconds = - 1 ) {
8687 self . reportingURL = reportingURL
8788 self . key = key
8889 self . httpCaptureConfig = httpCaptureConfig
8990 monitorTypes = MonitorTypes . current
91+ if anrThreshold > 0 {
92+ let anrInSeconds = Double ( anrThreshold) / 1000.0
93+ monitorTypes. insert ( . alertApplicationNotResponding( threshold: anrInSeconds) )
94+ }
9095 if enableCrashReporting {
9196 monitorTypes. insert ( . crash)
9297 }
@@ -111,14 +116,16 @@ class InstanaConfiguration {
111116 slowSendInterval: Instana . Types . Seconds = 0.0 ,
112117 usiRefreshTimeIntervalInHrs: Double = defaultUsiRefreshTimeIntervalInHrs,
113118 hybridAgentId: String ? = nil ,
114- hybridAgentVersion: String ? = nil )
119+ hybridAgentVersion: String ? = nil ,
120+ anrThreshold: Instana . Types . Milliseconds = - 1 )
115121 -> InstanaConfiguration {
116122 self . init ( reportingURL: reportingURL, key: key, httpCaptureConfig: httpCaptureConfig,
117123 enableCrashReporting: enableCrashReporting,
118124 suspendReporting: suspendReporting,
119125 slowSendInterval: slowSendInterval,
120126 usiRefreshTimeIntervalInHrs: usiRefreshTimeIntervalInHrs,
121127 hybridAgentId: hybridAgentId,
122- hybridAgentVersion: hybridAgentVersion)
128+ hybridAgentVersion: hybridAgentVersion,
129+ anrThreshold: anrThreshold)
123130 }
124131}
0 commit comments