You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #2216, the SDK measures the duration of app hangs. After we finish reporting fatal app hangs, we could also try to measure the duration of fatal app hangs.
The ANRTrackerV2 could periodically update a timestamp to disk during an ongoing ANR. When the OS terminates the app, we can calculate the difference between the timestamp of the stored app hang event and the onGoingAppHangTimeStamps to calculate the rough app hang duration.
It's worth noting that the AppHangV2Tracker can run for another 5 seconds until it gets terminated because when the user closes an app via a swipe-up gesture because the app gets around 5 seconds for cleanup tasks; see applicationWillTerminate. We can approve this behavior with test observations. When the OS watchdog kills the app process due to an app hang the AppHangTracker doesn't continue to run. Sadly, we can't reliably stop the AppHangV2Tracker on applicationWillTerminate because the OS posts this on the main thread and the main thread is blocked by the app hang. If we somehow identify if the app gets terminated by the user, by, for example, checking the applicationState, we could differentiate fatal app hangs between user terminated, and OS terminated, but further investigations are required.
The text was updated successfully, but these errors were encountered:
Description
With #2216, the SDK measures the duration of app hangs. After we finish reporting fatal app hangs, we could also try to measure the duration of fatal app hangs.
The ANRTrackerV2 could periodically update a timestamp to disk during an ongoing ANR. When the OS terminates the app, we can calculate the difference between the timestamp of the stored app hang event and the onGoingAppHangTimeStamps to calculate the rough app hang duration.
It's worth noting that the AppHangV2Tracker can run for another 5 seconds until it gets terminated because when the user closes an app via a swipe-up gesture because the app gets around 5 seconds for cleanup tasks; see applicationWillTerminate. We can approve this behavior with test observations. When the OS watchdog kills the app process due to an app hang the AppHangTracker doesn't continue to run. Sadly, we can't reliably stop the AppHangV2Tracker on applicationWillTerminate because the OS posts this on the main thread and the main thread is blocked by the app hang. If we somehow identify if the app gets terminated by the user, by, for example, checking the applicationState, we could differentiate fatal app hangs between user terminated, and OS terminated, but further investigations are required.
The text was updated successfully, but these errors were encountered: