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
Add option to enable or disable Activity Frame Tracking #2314
Conversation
Relevant Android 7.1 crash: #2310 |
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4dd88fe | 302.12 ms | 331.17 ms | 29.04 ms |
649f171 | 310.18 ms | 357.49 ms | 47.31 ms |
2c5f172 | 351.18 ms | 373.52 ms | 22.34 ms |
3d89dea | 345.59 ms | 364.06 ms | 18.47 ms |
54cebc8 | 331.12 ms | 385.14 ms | 54.02 ms |
c5ccd8a | 329.98 ms | 365.52 ms | 35.54 ms |
1e4690d | 354.69 ms | 387.88 ms | 33.19 ms |
7300956 | 324.20 ms | 353.79 ms | 29.58 ms |
649f171 | 300.58 ms | 367.44 ms | 66.86 ms |
3d89dea | 322.38 ms | 350.82 ms | 28.45 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4dd88fe | 1.73 MiB | 2.29 MiB | 579.50 KiB |
649f171 | 1.73 MiB | 2.32 MiB | 608.44 KiB |
2c5f172 | 1.73 MiB | 2.29 MiB | 580.10 KiB |
3d89dea | 1.74 MiB | 2.33 MiB | 604.92 KiB |
54cebc8 | 1.73 MiB | 2.29 MiB | 579.43 KiB |
c5ccd8a | 1.74 MiB | 2.33 MiB | 607.44 KiB |
1e4690d | 1.74 MiB | 2.33 MiB | 604.92 KiB |
7300956 | 1.73 MiB | 2.29 MiB | 578.69 KiB |
649f171 | 1.73 MiB | 2.32 MiB | 608.44 KiB |
3d89dea | 1.74 MiB | 2.33 MiB | 604.92 KiB |
Previous results on branch: feat/activity-frames-tracker-feature-flag
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1fa1cb9 | 315.24 ms | 353.04 ms | 37.80 ms |
ab76c2b | 308.43 ms | 342.78 ms | 34.35 ms |
217d03a | 302.60 ms | 354.96 ms | 52.36 ms |
a3665da | 379.18 ms | 470.32 ms | 91.14 ms |
0052e93 | 297.56 ms | 317.12 ms | 19.56 ms |
6375221 | 302.48 ms | 336.60 ms | 34.12 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1fa1cb9 | 1.73 MiB | 2.32 MiB | 607.13 KiB |
ab76c2b | 1.73 MiB | 2.32 MiB | 608.62 KiB |
217d03a | 1.73 MiB | 2.32 MiB | 608.62 KiB |
a3665da | 1.73 MiB | 2.32 MiB | 607.13 KiB |
0052e93 | 1.73 MiB | 2.32 MiB | 607.15 KiB |
6375221 | 1.73 MiB | 2.32 MiB | 607.14 KiB |
Codecov ReportBase: 80.21% // Head: 80.21% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #2314 +/- ##
=========================================
Coverage 80.21% 80.21%
Complexity 3475 3475
=========================================
Files 247 247
Lines 12906 12906
Branches 1735 1735
=========================================
Hits 10352 10352
Misses 1894 1894
Partials 660 660 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/IActivityFramesTracker.java
Outdated
Show resolved
Hide resolved
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, besides a few things 👍
sentry-android-core/src/main/java/io/sentry/android/core/IActivityFramesTracker.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java
Outdated
Show resolved
Hide resolved
@markushi have you tried using an Android emulator 7.2.1? |
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 only one question which @romtsn may have a stronger opinion about.
sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java
Outdated
Show resolved
Hide resolved
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 question about the naming of the option.
sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java
Outdated
Show resolved
Hide resolved
I've tried it on 7.1.1 (API 25) and the next available one: 8.0 (API 26), as well as 30, 31 and 33. Starting with 26 the issues does not occur anymore. The relevant error seems to happen on the native Android side when collecting the FrameMetrics, so there's little we can do about it. Here's the relevant snippet from the logs
|
try to bump the |
@marandaneto I tried with the latest available version( If anyone ever runs in the same issue again, I've used the following to automate turning on/off the screen many times: while true; do adb shell input keyevent 26 && sleep 1; done |
sentry-android-core/src/main/java/io/sentry/android/core/ActivityFramesTracker.java
Show resolved
Hide resolved
public ActivityFramesTracker(final @NotNull LoadClass loadClass) { | ||
this(loadClass, null); | ||
this(loadClass, new SentryAndroidOptions()); |
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.
Creating a new options here won't help, the feature will be always enabled and can't be disabled since options
is private, maybe better to just remove this ctor in this case and fix on Flutter/RN if necessary.
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 feature will be always enabled
exactly, that matches the existing behavior thus I thought it makes sense. But in hindsight it's actually more confusing than helpful, let me remove this again 👍
@@ -25,48 +25,57 @@ | |||
public final class ActivityFramesTracker { | |||
|
|||
private @Nullable FrameMetricsAggregator frameMetricsAggregator = null; | |||
private boolean androidXAvailable = true; | |||
private final SentryAndroidOptions options; |
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.
Missing nullability anotations.
📜 Description
Adds an API to enable (that's the default, as before) or disable the Activity Frames Tracking, which is used to report slow and frozen frames.
💡 Motivation and Context
The Activity Frames Tracking has already caused some troubles in the past, and as we depend on androidx it would be great to enable or disable it on demand. Also we recently saw crashes for Android 7.1 (in a very specific setup) caused by using the underlying
FrameMetricsAggregator
API.💚 How did you test it?
Added relevant tests.
📝 Checklist
🔮 Next steps