-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(Unity): Updated ANR detection explainer - Single vs Multi Threaded #14834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will decrease total bundle size by 1.19kB (-0.01%) ⬇️. This is within the configured threshold ✅ Detailed changes
ℹ️ *Bundle size includes cached data from a previous commit Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
|
On platforms that do no support multithreading the ANR detection falls back to relying on the coroutine itself to report if the last time it executed exceeds the timeout. | ||
### Platforms with Multi-Threading Support | ||
|
||
On platforms that support multithreading, the ANR detection works in two parts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On platforms that support multithreading, the ANR detection works in two parts: | |
On platforms that support multithreading, the ANR detection has two components: |
|
||
On platforms that support multithreading, the ANR detection works in two parts: | ||
1. A coroutine periodically resets a counter | ||
2. A background thread increments and monitors this counter. It reports an ANR event when the threshold defined on `options.AnrTimeout` is exceeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. A background thread increments and monitors this counter. It reports an ANR event when the threshold defined on `options.AnrTimeout` is exceeded | |
2. A background thread increments and monitors this counter, triggering an ANR event when the value exceeds the threshold defined in `options.AnrTimeout`. |
### Platforms without Multi-Threading Support - WebGL | ||
|
||
On platforms without multi-threading support like WebGL, the ANR detection uses a slightly different approach: | ||
- A single coroutine using a `Stopwatch` to measure elapsed time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A single coroutine using a `Stopwatch` to measure elapsed time | |
- A single coroutine uses a `Stopwatch` to measure elapsed time |
- A single coroutine using a `Stopwatch` to measure elapsed time | ||
- When the coroutine detects that more time has passed than the ANR timeout, it reports the ANR event | ||
|
||
The drawback here is that the ANR detection relies on the game recovering from the not-responding state to report the event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The drawback here is that the ANR detection relies on the game recovering from the not-responding state to report the event. | |
The drawback here is that the ANR detection relies on the game recovering from the non-responsive state to report the event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There is a difference in how the integration works based on whether the SDK can make use of multi threaded - or not.