-
Notifications
You must be signed in to change notification settings - Fork 899
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
Uplift P3A search engine switch P3A to 1.32.x #10625
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a P3A probe to record when the default search engine is changed, and whether it's a transition between Brave Search or one of the other major services. This helps understand what options are seem better to users. Keep track of the previous default search engine url. The event the tracker observes only indicates something has changed, and by then the previous state is no longer accessible; we need this to correctly mark the transition in our matrix, separate from whatever the original default was at startup. Move the actual record step into an object method so it can access the saved previous default. This simplifies calling it at startup to set the initial kNoSwitch answer. Note: this means we only report a change if the ping is sent from the same application instance. We don't reset to kNoSwitch at the end of the weekly sample cadence, and restarting the browser always resets. Closes brave/brave-browser#18224
Add a browser test to verify we record transitions as expected.
This is a helper class to record events for later P3A reporting. It remembers a sequence of enum values for a week, and can return the most recently-added value within that time period, if any.
Use WeeklyEventStorage to keep track of default search engine changes over the previous week, so we can return an accurate report of whether a switch happened during the P3A measurement period. This registers a new pref to back the WeeklyEventStorage data.
Like the other SearchEngineTracker browser test, this gives unstable results in ci, tracked in brave/brave-browser#13057. Disable the test for now, and remove the `MergeHistogramDeltasForTesting` which we don't expect is necessary and made no difference in testing.
Specialize WeeklyEventStorage to use the basic `int` type for event codes, rather than being a template class. The removes type information at call sites using an `enum class` but also reduces code bloat, which we prefer.
- Document the motivation for setting the region. - Fix a comment typo.
kjozwiak
approved these changes
Oct 22, 2021
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.
Uplift into 1.32.x
approved after deliberating with @brave/uplift-approvers. QA has verified the PR on Nightly as per #10300 (comment).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uplift #10300 to beta so we get measurements on Brave Search rollout sooner.
Resolves brave/brave-browser#18224
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
See #10300.