-
-
Notifications
You must be signed in to change notification settings - Fork 372
Flush Logs on WillTerminate or WillResignActive Notifications
#6909
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
Conversation
WillTerminate or WillResignActive` App State
WillTerminate or WillResignActive` App StateWillTerminate or WillResignActive App State
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6909 +/- ##
========================================
Coverage ? 85.092%
========================================
Files ? 454
Lines ? 27697
Branches ? 12145
========================================
Hits ? 23568
Misses ? 4085
Partials ? 44
Continue to review full report in Codecov by Sentry.
|
|
The app state manager is only enabled for UIKit, but the notification-equivalents for terminate/active should also be available for macOS. Is this intended behaviour? |
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b9c733a | 1195.49 ms | 1220.23 ms | 24.74 ms |
| 9e0030e | 1222.78 ms | 1242.23 ms | 19.45 ms |
| 916edbe | 1243.86 ms | 1256.11 ms | 12.25 ms |
| 884b224 | 1221.11 ms | 1255.88 ms | 34.77 ms |
| 650d802 | 1231.86 ms | 1255.64 ms | 23.78 ms |
| d83b35a | 1212.48 ms | 1237.02 ms | 24.54 ms |
| bc0a04c | 1226.83 ms | 1255.04 ms | 28.21 ms |
| ec3fc3a | 1212.92 ms | 1245.06 ms | 32.14 ms |
| 2a36c3f | 1227.27 ms | 1246.89 ms | 19.63 ms |
| 0b6776b | 1230.18 ms | 1262.06 ms | 31.88 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b9c733a | 23.74 KiB | 1021.49 KiB | 997.74 KiB |
| 9e0030e | 23.75 KiB | 893.72 KiB | 869.97 KiB |
| 916edbe | 23.75 KiB | 908.41 KiB | 884.66 KiB |
| 884b224 | 23.75 KiB | 879.55 KiB | 855.80 KiB |
| 650d802 | 23.74 KiB | 913.13 KiB | 889.39 KiB |
| d83b35a | 23.75 KiB | 913.17 KiB | 889.42 KiB |
| bc0a04c | 23.75 KiB | 933.32 KiB | 909.57 KiB |
| ec3fc3a | 23.74 KiB | 1022.75 KiB | 999.01 KiB |
| 2a36c3f | 23.75 KiB | 874.45 KiB | 850.71 KiB |
| 0b6776b | 23.75 KiB | 968.23 KiB | 944.49 KiB |
Previous results on branch: feat/flush-logs-on-app-state-change
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4d08953 | 1219.49 ms | 1252.85 ms | 33.36 ms |
| 58c01c4 | 1193.19 ms | 1242.47 ms | 49.28 ms |
| 862c32d | 1212.94 ms | 1246.50 ms | 33.56 ms |
| a6be137 | 1221.02 ms | 1260.93 ms | 39.91 ms |
| 27d2fb4 | 1228.62 ms | 1260.15 ms | 31.53 ms |
| 2cb9aef | 1228.32 ms | 1265.86 ms | 37.54 ms |
| 6b6ef93 | 1192.06 ms | 1212.08 ms | 20.02 ms |
| e1bf267 | 1215.20 ms | 1241.04 ms | 25.84 ms |
| 9ee58f1 | 1231.78 ms | 1268.67 ms | 36.89 ms |
| 5a96fbe | 1223.24 ms | 1239.82 ms | 16.57 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4d08953 | 24.14 KiB | 1.02 MiB | 1017.81 KiB |
| 58c01c4 | 24.14 KiB | 1.01 MiB | 1013.67 KiB |
| 862c32d | 24.14 KiB | 1.02 MiB | 1017.77 KiB |
| a6be137 | 24.14 KiB | 1.02 MiB | 1017.81 KiB |
| 27d2fb4 | 24.14 KiB | 1.02 MiB | 1017.82 KiB |
| 2cb9aef | 24.14 KiB | 1.02 MiB | 1017.76 KiB |
| 6b6ef93 | 24.14 KiB | 1.01 MiB | 1015.51 KiB |
| e1bf267 | 24.14 KiB | 1.01 MiB | 1015.57 KiB |
| 9ee58f1 | 24.14 KiB | 1.01 MiB | 1013.68 KiB |
| 5a96fbe | 24.14 KiB | 1.01 MiB | 1015.46 KiB |
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.
Thanks for doing this. I found a few high-level issues we need to address before I give this a closer look.
# Conflicts: # Sentry.xcodeproj/project.pbxproj
Tests/SentryTests/Integrations/Log/SentryLogFlushIntegrationTests.swift
Outdated
Show resolved
Hide resolved
# Conflicts: # Sources/Swift/Core/Integrations/Integrations.swift
WillTerminate or WillResignActive App StateWillTerminate or WillResignActive Notifications
Tests/SentryTests/Integrations/Log/FlushLogsIntegrationTests.swift
Outdated
Show resolved
Hide resolved
philipphofmann
left a comment
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.
Thanks, @denrase, we're getting closer to an LGTM.
Sources/Swift/Core/Integrations/FramesTracking/SentryFramesTracker.swift
Outdated
Show resolved
Hide resolved
Tests/SentryTests/Integrations/Log/FlushLogsIntegrationTests.swift
Outdated
Show resolved
Hide resolved
Tests/SentryTests/Integrations/Log/FlushLogsIntegrationTests.swift
Outdated
Show resolved
Hide resolved
Tests/SentryTests/Integrations/Log/FlushLogsIntegrationTests.swift
Outdated
Show resolved
Hide resolved
# Conflicts: # Sentry.xcodeproj/project.pbxproj # Sources/Swift/Core/Integrations/Integrations.swift # Sources/Swift/Integrations/Session/SessionTracker.swift # Sources/Swift/SentryDependencyContainer.swift
philprime
left a comment
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, left some feedback to consider
📜 Description
captureLogson batcher if app terminatescaptureLogson batcher if app resigns activeIntroduces listeners on the AppState and observes it in a conditional (UIKit) integration.
💡 Motivation and Context
Implements missing behaviour from batch processor spec.
Closes #6478
💚 How did you test it?
Added tests and tested manually.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.