Skip to content

Commit ec6f2a6

Browse files
Hongyan JiangGitHub Enterprise
authored andcommitted
detect Application Not Responding scenario
1 parent 2b2b883 commit ec6f2a6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## 1.8.5
4+
- detect Application Not Responding scenario
45
- remove code for iOS versions lower than 12
56

67
## 1.8.4

Sources/InstanaAgent/Configuration/InstanaConfiguraton.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)