-
-
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
feat: Add SwiftUI performance tracking #2271
Conversation
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.
Great job, @brustolin. The solution is so simple, and simple is hard to achieve.
/// | ||
/// | ||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6.0, *) | ||
public struct SentryPerformanceView<Content: View>: View { |
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.
m
: We have some UITests for this class, but I think adding some unit tests would also be great. We could move all the logic to an internal class and write some unit tests for it.
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.
Most logics in here are related to SwiftUI events, I believe the best way to test this is in a UI test, unit tests would be just redundant, I could create a test for extractName
, but it does not seems worth to have a unit test just for this, we are also testing its result in the UI test.
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
As discussed in a call. We still need to |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 8.0.0 #2271 +/- ##
==========================================
+ Coverage 78.39% 78.44% +0.04%
==========================================
Files 241 241
Lines 22290 22273 -17
Branches 9842 9832 -10
==========================================
- Hits 17475 17472 -3
+ Misses 4361 4350 -11
+ Partials 454 451 -3
Continue to review full report at Codecov.
|
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.
Some parts still need fixing.
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
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, thanks @brustolin 👏👍
CI is not happy, though @brustolin. |
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
* 8.0.0: (31 commits) tests: Reenable testAddAndRemoveData (#2533) feat: support SENTRY_DSN environment var on macOS (#2534) Remove duplicate entry (#2532) fix: ARC issue for FileManager (#2525) feat: Add SwiftUI performance tracking (#2271) fix: Remove all permission checks (#2529) Remove the automatic `viewAppearing` span (#2511) Fix and reenable testANRDetected_UpdatesAppStateToTrue (#2526) fix: Don't add out of date context for crashes (#2523) ref: Rename isOOM to watchdog in Client (#2520) test: Fix disabled failing watchdog test (#2521) build(deps): bump github/codeql-action from 2.1.35 to 2.1.36 (#2516) Rename the watchdog option and integration (#2513) feat: Enable CaptureFailedRequests by default (#2507) test: Fix asserts for SentryCrashTestInstallation (#2500) meta: User interaction tracing enabled per default (#2506) ref: Rename OOM to Watchdog Terminations (#2499) feat: enableUserInteractionTracing is GA (#2503) build(deps): bump nokogiri from 1.13.9 to 1.13.10 (#2505) perf: Don't attach headers for SentryNoOpSpan (#2498) ...
📜 Description
Created a wrapper view to track performance of SwiftUI parts
💡 Motivation and Context
See #1737
💚 How did you test it?
With Sample app and UI Tests
📝 Checklist
🔮 Next steps