-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
fix: Add app start to first finished transaction #2252
Merged
philipphofmann
merged 9 commits into
master
from
fix/app-start-on-first-finished-transaction
Oct 5, 2022
Merged
fix: Add app start to first finished transaction #2252
philipphofmann
merged 9 commits into
master
from
fix/app-start-on-first-finished-transaction
Oct 5, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The SDK added the app start measurement and spans to the first finished auto-generated UIViewController transaction. The first finished UIViewController transaction is not necessarily the transaction of the first loaded screen. As auto-generated transactions for UIViewControllers wait for all children to finish, it may kick off, for example, a web request that lasts for a couple of seconds in the background. In the meantime, the user navigates to another screen, which finishes loading before the web request. The SDK added the app start data to the wrong transaction in such an edge case. This is fixed now by adding the app start data to the first started transaction. Fixes GH-2248
brustolin
reviewed
Oct 4, 2022
@@ -58,6 +58,7 @@ @implementation SentryTracer { | |||
BOOL _waitForChildren; | |||
SentryTraceContext *_traceContext; | |||
SentryProfilesSamplerDecision *_profilesSamplerDecision; | |||
SentryAppStartMeasurement *appStartMeasurement; |
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.
I see what you did here 😁👏🏻...
brustolin
approved these changes
Oct 4, 2022
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
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e2f1150 | 1220.39 ms | 1249.94 ms | 29.55 ms |
ee127f4 | 1203.49 ms | 1231.28 ms | 27.79 ms |
4a66f00 | 1259.84 ms | 1281.66 ms | 21.82 ms |
864c39a | 1191.14 ms | 1233.38 ms | 42.24 ms |
b172a8b | 1257.68 ms | 1272.38 ms | 14.70 ms |
4a66f00 | 1224.73 ms | 1241.14 ms | 16.41 ms |
864c39a | 1239.45 ms | 1256.76 ms | 17.31 ms |
347a8e9 | 1243.50 ms | 1265.90 ms | 22.40 ms |
e958899 | 1230.40 ms | 1248.31 ms | 17.91 ms |
a5ca27b | 1231.31 ms | 1252.56 ms | 21.25 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e2f1150 | 20.51 KiB | 333.10 KiB | 312.59 KiB |
ee127f4 | 20.51 KiB | 333.10 KiB | 312.59 KiB |
4a66f00 | 20.51 KiB | 331.79 KiB | 311.28 KiB |
864c39a | 20.51 KiB | 335.57 KiB | 315.06 KiB |
b172a8b | 20.51 KiB | 331.79 KiB | 311.28 KiB |
4a66f00 | 20.51 KiB | 331.79 KiB | 311.28 KiB |
864c39a | 20.51 KiB | 335.57 KiB | 315.06 KiB |
347a8e9 | 20.51 KiB | 333.16 KiB | 312.65 KiB |
e958899 | 20.51 KiB | 331.92 KiB | 311.41 KiB |
a5ca27b | 20.51 KiB | 331.81 KiB | 311.31 KiB |
Previous results on branch: fix/app-start-on-first-finished-transaction
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d8176b6 | 1223.71 ms | 1258.48 ms | 34.77 ms |
b00b932 | 1209.52 ms | 1242.17 ms | 32.65 ms |
667289c | 1217.00 ms | 1230.14 ms | 13.14 ms |
1963019 | 1259.18 ms | 1267.12 ms | 7.94 ms |
5bcd104 | 1246.86 ms | 1263.78 ms | 16.92 ms |
e85c3b9 | 1239.02 ms | 1246.06 ms | 7.04 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d8176b6 | 20.51 KiB | 333.09 KiB | 312.58 KiB |
b00b932 | 20.51 KiB | 333.08 KiB | 312.57 KiB |
667289c | 20.51 KiB | 333.08 KiB | 312.57 KiB |
1963019 | 20.51 KiB | 333.09 KiB | 312.58 KiB |
5bcd104 | 20.51 KiB | 333.09 KiB | 312.58 KiB |
e85c3b9 | 20.51 KiB | 333.09 KiB | 312.58 KiB |
bruno-garcia
approved these changes
Oct 4, 2022
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 Description
The SDK added the app start measurement and spans to the first finished auto-generated UIViewController transaction. The first finished UIViewController transaction is not necessarily the transaction of the first loaded screen. As auto-generated transactions for UIViewControllers wait for all children to finish, it may kick off, for example, a web request that lasts for a couple of seconds in the background. In the meantime, the user navigates to another screen, which finishes loading before the web request. The SDK added the app start data to the wrong transaction in such an edge case. This is fixed now by adding the app start data to the first started transaction.
💡 Motivation and Context
Fixes GH-2248
💚 How did you test it?
Unit tests and on a real device with the steps described in GH-2248.
LoremIpsumViewController without the app start data.
![Screen Shot 2022-10-04 at 15 15 05](https://user-images.githubusercontent.com/2443292/193828708-453575f5-3b90-4e04-9ad3-40740304dbcc.png)
iOS_Swift.ViewController with the app start data
![Screen Shot 2022-10-04 at 15 15 24](https://user-images.githubusercontent.com/2443292/193828777-73a4e690-57c6-41a2-b478-c86521deab7d.png)
📝 Checklist
🔮 Next steps