sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Add duration of App hang

Open barisyild opened this issue 1 year ago • 2 comments

Problem Statement

When the application freezes, we cannot see whether it freezes forever or for a few seconds or how many seconds it freezes.

Solution Brainstorm

When the application responds again, this is transmitted to the sentry servers and may add a suffix such as "Unfreezed after 5 seconds".

Are you willing to submit a PR?

No response

barisyild avatar Jan 12 '24 22:01 barisyild

I like the idea, @barisyild. Thanks for opening the issue.

Our code can't detect precisely how long the app hung, but we can provide an approximation. The major problem to solve is that we immediately report the app hang once our logic detects it because you never know how much time you have left until the OS terminates your app without any notice. We would need to store the app hang event somewhere and wait for it to stop, and then we could add the approximate hang duration. If the app hang never stops and the OS terminates it, we need to read the stored app hang when starting the SDK and mark it as a more severe app hang.

philipphofmann avatar Jan 15 '24 14:01 philipphofmann

If we persist App Hang information to disk, and the app gets terminated before we can send the event, we can use this information to elevate issue severity.

kahest avatar Jan 17 '24 13:01 kahest

This is a duplicate of https://github.com/getsentry/sentry-cocoa/issues/2216.

philipphofmann avatar Aug 08 '24 13:08 philipphofmann