-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add FXIOS-10896 iOS Add additional fields to the usage ping #23950
Add FXIOS-10896 iOS Add additional fields to the usage ping #23950
Conversation
Client.app: Coverage: 32.38
Generated by 🚫 Danger Swift against d023b4b |
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.
A couple of suggestions, nothing to block on. Looks just as I expected and I really appreciate the consistency with the Fenix implementation. Bravo 🎉
} | ||
|
||
func handleForegroundEvent() { | ||
durationStartMs = currentTimeProvider() |
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.
You could also use the start()
API of the metric, and then stopAndAccumulate()
in the background handler if you didn't want to manage the timer yourself, but this is perfectly acceptable too. The benefit of letting Glean manage the timer is just that you don't have to, and glean uses a monotonic time source (I'm not sure what currentTimeProvider's specifications are for this, actually)
bugs: | ||
- https://github.com/mozilla-mobile/firefox-ios/issues/23785 | ||
data_reviews: | ||
- https://github.com/mozilla-mobile/firefox-ios/pull/23950 |
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.
Please link to the original Glean duration for the data-review and bugs also, as that is the review that covers this collection. You can find these links in the Glean dictionary for this and other metrics which have been duplicated for the purpose of the usage-reporting ping.
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.
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.
Yes, that is correct. Please include the data-review link(s) from the Glean definitions in the definitions you are adding. That way the data-review that covers the collection of these is linked in the metadata and easy to find from the Glean Dictionary and other tools. You can also copy over the linked bugs, but that isn't as necessary as the data-reviews. Thanks!
@travis79 I updated the PR with the requested changes. One more thing I would like to ask is how will this observer be working? Where will it be enabled, and what toggled should be tied to? Added @nbhasin2 @dicarobinho for review. |
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.
Is looking good to me
Glean's internal observers are set up right after Glean is initialized, so I expect these to be set up early enough to trigger correctly. Glean will often be initialized after the first The preference should not be connected to whether or not the observers are registered, Glean will need to be able to still receive these events regardless of whether the usage-reporting preference is enabled. As long as the |
Okay, I was only asking this because on Android it seems there is some condition for the service to be registered based on a condition. |
📜 Tickets
Jira ticket
Github issue
💡 Description
Add additional fields to the usage ping
📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)