Skip to content
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

RUMM-1615 Refacto RUMAutoInstrumentation to RUMInstrumentation #652

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

maxep
Copy link
Member

@maxep maxep commented Oct 29, 2021

What and why?

Refacto RUMAutoInstrumentation to RUMInstrumentation to prepare support for manual-instrumentation of SwiftUI alongside auto-instrumentation of UIKit.

The SwiftUI instrumentation will introduce a new view handler for tracking SwiftUI views navigation. this new handler will be instantiated and managed by the RUMInstrumentation that centralised all handlers.

How?

The RUMInstrumentation will now be instantiated when RUM is enabled regardless of the auto-instrumentation setup (with UIKit predicates or long task threshold). Its underlying auto-instrumentations can be activated independently to work alongside SwiftUI.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

@maxep maxep requested a review from a team as a code owner October 29, 2021 12:51
Comment on lines +21 to +22
private weak var notificationCenter: NotificationCenter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addition: Keep a notification center weak ref to remove observers on deinit. Even if we only have a single handler and a single sdk instance, it's an assumption we can't make at this level.

@@ -6,17 +6,17 @@

import UIKit

internal protocol UIKitRUMUserActionsHandlerType: RUMCommandPublisher {
internal protocol UIEventHandler: RUMCommandPublisher {
Copy link
Member Author

@maxep maxep Oct 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarity on what we handle here.

Same with UIKitRUMViewsHandlerType -> UIViewControllerHandler

Comment on lines +408 to +411

XCTAssertNotNil(longTaskConfigured.rum!.instrumentation!.longTaskThreshold)
XCTAssertNil(longTaskConfigured.rum!.instrumentation!.uiKitRUMViewsPredicate)
XCTAssertNil(longTaskConfigured.rum!.instrumentation!.uiKitRUMUserActionsPredicate)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding test for the long task auto-instrumentation and remove XCTAssertNil on the config instance itself.

@maxep maxep self-assigned this Nov 2, 2021
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good cleanup 👍. I found a few typos otherwise it's great.

@maxep maxep force-pushed the maxep/RUMM-1615/intrumentation-refacto branch from b3e1017 to 7b103d6 Compare November 2, 2021 09:04
@DataDog DataDog deleted a comment from ncreated Nov 2, 2021
@DataDog DataDog deleted a comment from ncreated Nov 2, 2021
@DataDog DataDog deleted a comment from ncreated Nov 2, 2021
@maxep maxep merged commit bcb3149 into feature/swiftui Nov 2, 2021
@maxep maxep deleted the maxep/RUMM-1615/intrumentation-refacto branch November 2, 2021 10:01
@maxep maxep mentioned this pull request Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants