-
-
Notifications
You must be signed in to change notification settings - Fork 435
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 time-to-full-display span to activity transactions #2432
Conversation
…tyStarted(), not onActivityCreated() anymore
…pan per activity updated ttidSpan finishing with Firebase's method: span is finished after the very first frame has been drawn using view.getViewTreeObserver().addOnDrawListener added FirstDrawDoneListener Sentry.getSpan() could cause issues
# Conflicts: # CHANGELOG.md # sentry-android-core/src/main/java/io/sentry/android/core/ActivityLifecycleIntegration.java # sentry-android-core/src/test/java/io/sentry/android/core/ActivityLifecycleIntegrationTest.kt
added a FullyDrawnReporter instance to SentryAndroid added a new api SentryAndroid.reportFullyDrawn
sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroid.java
Outdated
Show resolved
Hide resolved
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java # sentry-android-core/src/test/java/io/sentry/android/core/AndroidOptionsInitializerTest.kt # sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MainActivity.java
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4b32504 | 357.14 ms | 404.04 ms | 46.90 ms |
fe30606 | 327.46 ms | 351.74 ms | 24.28 ms |
fe30606 | 310.82 ms | 335.36 ms | 24.55 ms |
c1399c1 | 345.06 ms | 385.49 ms | 40.43 ms |
754021c | 358.70 ms | 361.98 ms | 3.28 ms |
14c083a | 350.82 ms | 388.86 ms | 38.04 ms |
5fa24ec | 326.29 ms | 384.53 ms | 58.24 ms |
f6a135d | 263.96 ms | 383.59 ms | 119.63 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4b32504 | 1.73 MiB | 2.34 MiB | 623.74 KiB |
fe30606 | 1.73 MiB | 2.34 MiB | 623.74 KiB |
fe30606 | 1.73 MiB | 2.34 MiB | 623.74 KiB |
c1399c1 | 1.73 MiB | 2.33 MiB | 620.61 KiB |
754021c | 1.73 MiB | 2.33 MiB | 623.06 KiB |
14c083a | 1.73 MiB | 2.33 MiB | 620.61 KiB |
5fa24ec | 1.73 MiB | 2.33 MiB | 620.61 KiB |
f6a135d | 1.73 MiB | 2.33 MiB | 623.10 KiB |
Previous results on branch: android/ttfd
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a16e791 | 345.26 ms | 360.78 ms | 15.52 ms |
16ebe65 | 333.80 ms | 386.75 ms | 52.95 ms |
5604d15 | 308.69 ms | 358.10 ms | 49.41 ms |
e8cdc9f | 361.57 ms | 405.46 ms | 43.89 ms |
9bbb1ce | 334.72 ms | 357.70 ms | 22.98 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a16e791 | 1.73 MiB | 2.34 MiB | 623.96 KiB |
16ebe65 | 1.73 MiB | 2.34 MiB | 624.06 KiB |
5604d15 | 1.73 MiB | 2.34 MiB | 624.06 KiB |
e8cdc9f | 1.73 MiB | 2.34 MiB | 623.94 KiB |
9bbb1ce | 1.73 MiB | 2.33 MiB | 623.52 KiB |
Codecov ReportBase: 80.19% // Head: 80.20% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2432 +/- ##
=========================================
Coverage 80.19% 80.20%
- Complexity 3948 3960 +12
=========================================
Files 323 324 +1
Lines 14911 14937 +26
Branches 1967 1968 +1
=========================================
+ Hits 11958 11980 +22
- Misses 2179 2183 +4
Partials 774 774
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. |
added FullyDisplayedReporter and put it in the options added ttfd span in ActivityLifecycleIntegration ttid and ttfd spans are now finished with DEADLINE_EXCEEDED instead of CANCELLED when new activity is started or activity is destroyed added io.sentry.traces.time-to-full-display.enable manifest option and enableTimeToFullDisplayTracing option, disabled by default
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/ActivityLifecycleIntegration.java # sentry-android-core/src/test/java/io/sentry/android/core/ActivityLifecycleIntegrationTest.kt
added FullyDisplayedReporter and put it in the options added ttfd span in ActivityLifecycleIntegration ttid and ttfd spans are now finished with DEADLINE_EXCEEDED instead of CANCELLED when new activity is started or activity is destroyed added io.sentry.traces.time-to-full-display.enable manifest option and enableTimeToFullDisplayTracing option, disabled by default
sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/SecondActivity.kt
Outdated
Show resolved
Hide resolved
reenabled Activity auto instrumentation auto-finish Put `Sentry.reportFullDisplayed()` in all activities of the sample app
reenabled Activity auto instrumentation auto-finish Put `Sentry.reportFullDisplayed()` in all activities of the sample app
So, I quickly checked how the new Activity transactions look, and I've spotted 2 problems there:
I did some quick tests, and, indeed, if I call However, If I post an async runnable to call So, I believe we should align this behavior with how Google does it and cap the TTFD end time to TTID, if it's called earlier than TTID happened (and also document it for other SDKs). Sorry for the long-read :) |
We can think about it for sure
I was thinking the same, as that's what Firebase is doing, too. |
Sounds good, I've just approved the PR, feel free to merge and open a new one |
📜 Description
added ttfd span
added a FullyDrawnReporter into the options
added a new api
Sentry.reportFullyDrawn()
💡 Motivation and Context
We want to allow the user to report when the ui is fully loaded for them, e.g. after retrieving some data from some api call and fill their own ui
More info can be found on this rfc
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps
Update docs