Skip to content

Commit

Permalink
RUM-2925 CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ncreated committed Feb 21, 2024
1 parent a091990 commit 97f4286
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ class AppHangsMonitoringTests: XCTestCase {
private var rumConfig = RUM.Configuration(applicationID: .mockAny())

override func setUp() {
super.setUp()
core = DatadogCoreProxy()
}

override func tearDown() {
core.flushAndTearDown()
core = nil
super.tearDown()
}

func testWhenMainThreadHangsAboveThreshold_itTracksAppHang() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal struct AppHang {
}

internal final class AppHangsWatchdogThread: Thread {
struct Constants {
enum Constants {
/// The "idle" interval for sleeping the watchdog thread before scheduling the next task on the main queue, represented as a percentage of the `appHangThreshold`.
///
/// Introducing even a small sleep significantly reduces CPU consumption by the watchdog thread (nearly 0%). No sleep would result in close to 100% CPU usage.
Expand Down Expand Up @@ -114,7 +114,7 @@ internal final class AppHangsWatchdogThread: Thread {
// If the hang duration is irrealistically long (way more than assumed iOS watchdog termination limit: ~10s), send telemetry.
// This could be another false-positive caused by thread suspension between the two `wait()` calls.
telemetry.debug("Detected an App Hang with an unusually long duration", attributes: ["hang_duration": hangDuration])
return
continue
}

let appHang = AppHang(
Expand Down

0 comments on commit 97f4286

Please sign in to comment.