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.
Checklist
master
Motivation and Context
While our
Analytics.MultiTracker
was implemented to be dynamically configured by allowing registering/unregistering sub trackers, in reality this didn't bring much benefit (or at all) as from our experience the tracker is typically configured once during app startup. To allow this dynamism while being thread safe, it resorted to synchronization primitives (i.e.Atomic
) on the state, which in practice causes one lock/unlock per track call (trackers). This is obviously a very high price to pay when we consider that the dynamism it allows is rarely used. So, this dynamism has been removed in favor of configuring the tracker once oninit
, passing in the sub-trackers to use.Additionally, some some minor improvements were made to
Analytics
related types.Description
Make
Analytics.MultiTracker
have its sub-trackers be configured oninit
, avoiding complexity and contention due to handling concurrent operations.Remove
ID
fromAnalyticsTracker
, as it was used mostly to keep track of registered trackers.Add
eraseToAnyAnalyticsRracker()
helper inAnalyticsTracker
to facilitate type erasing trackers to passintoAnalytics.MultiTracker
s.Add
_wrapped
helper property inAnyAnalyticsTracker
to hold a reference to the wrapped tracker instance.