Closed
Bug 873496
Opened 13 years ago
Closed 12 years ago
Provider: searches
Categories
(Firefox Health Report Graveyard :: Client: Android, defect, P1)
Tracking
(firefox23+ fixed)
RESOLVED
FIXED
Firefox 24
People
(Reporter: rnewman, Assigned: rnewman)
References
Details
Attachments
(2 files, 3 obsolete files)
|
11.64 KB,
patch
|
rnewman
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
5.14 KB,
patch
|
nalexander
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Splitting this out from the original bug, because it spans a tree merge.
| Assignee | ||
Comment 1•13 years ago
|
||
Ensure that we have filters for only partner engines.
| Assignee | ||
Comment 2•13 years ago
|
||
Supersedes the draft patch in Bug 870110. I think a double-reporting bug just popped up this week, so need to check on that, but let's have a prelim review regardless!
Attachment #751213 -
Flags: review?(cpeterson)
Comment 3•13 years ago
|
||
Comment on attachment 751213 [details] [diff] [review]
Proposed patch. v1
Review of attachment 751213 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM with some questions and suggestions.
::: mobile/android/base/AwesomeBar.java
@@ +403,5 @@
> + * {@link BrowserHealthRecorder#SEARCH_LOCATIONS}.
> + */
> + private static void recordSearch(String identifier, String where) {
> + BrowserHealthRecorder recorder = BrowserHealthRecorder.getInstance();
> + Log.i("GeckoXXX", "Recording search: " + recorder + ", " + identifier + ", " + where);
You should probably replace "GeckoXXX" with this class' LOGTAG.
::: mobile/android/base/health/BrowserHealthRecorder.java
@@ +153,5 @@
> public void handleMessage(String event, JSONObject message) {
> try {
> + if (event.equals(EVENT_KEYWORD_SEARCH)) {
> + recordSearch(message.getString("identifier"), "bartext");
> + }
Some people on our team prefer constant-first style string comparisons like `EVENT_KEYWORD_SEARCH.equals(event)` (because they are null-proof). I don't have a strong opinion. <:)
@@ +167,5 @@
> + public static final String[] SEARCH_LOCATIONS = {
> + "barkeyword",
> + "barsuggest",
> + "bartext",
> + };
Does SEARCH_LOCATIONS need to be public? I don't see any other classes referencing it. They use hard coded names like "barkeyword".
@@ +170,5 @@
> + "bartext",
> + };
> +
> + private void initializeSearchProvider(final EventDispatcher dispatcher) {
> + this.storage.ensureMeasurementInitialized("org.mozilla.searches.counts", 3, new MeasurementFields() {
Where does the magic number 3 come from? SEARCH_LOCATIONS.length?
@@ +173,5 @@
> + private void initializeSearchProvider(final EventDispatcher dispatcher) {
> + this.storage.ensureMeasurementInitialized("org.mozilla.searches.counts", 3, new MeasurementFields() {
> + @Override
> + public Iterable<FieldSpec> getFields() {
> + ArrayList<FieldSpec> out = new ArrayList<FieldSpec>();
You might consider using the ArrayList constructor with a capacity hint of SEARCH_LOCATIONS.length. If you think that is an ugly micro-optimization, then feel free to ignore this suggestion.
@@ +211,5 @@
> + public void run() {
> + Log.d(LOG_TAG, "Recording search: " + key + ", " + location +
> + " (" + day + ", " + env + ").");
> + // TODO: memoize.
> + final int searchField = storage.getField("org.mozilla.searches.counts", 3, location).getID();
Again, where does the magic number 3 come from?
Attachment #751213 -
Flags: review?(cpeterson) → review+
| Assignee | ||
Comment 4•13 years ago
|
||
> You should probably replace "GeckoXXX" with this class' LOGTAG.
Prelim patch :D
> Some people on our team prefer constant-first style string comparisons like
> `EVENT_KEYWORD_SEARCH.equals(event)` (because they are null-proof). I don't
> have a strong opinion. <:)
Yeah, I do too -- call it Friday afternoon inconsistency!
> Does SEARCH_LOCATIONS need to be public? I don't see any other classes
> referencing it. They use hard coded names like "barkeyword".
I generally like having descriptive/API constants be public, and in this case we have JavaDocs pointing to it from other classes.
> Where does the magic number 3 come from? SEARCH_LOCATIONS.length?
It's a version number. It's part of the FHR payload format. I'll lift that out into a named constant.
> You might consider using the ArrayList constructor with a capacity hint of
> SEARCH_LOCATIONS.length. If you think that is an ugly micro-optimization,
> then feel free to ignore this suggestion.
Ugly is beautiful!
| Assignee | ||
Comment 5•13 years ago
|
||
Review comments addressed, tested more thoroughly. Carrying forward flag. Thanks, Chris!
Attachment #751213 -
Attachment is obsolete: true
Attachment #751249 -
Flags: review+
| Assignee | ||
Comment 6•13 years ago
|
||
Testing notes:
There are three ways to initiate a search in Fennec. You'll see log output for each.
* Type something in the awesomebar, hit enter.
D/GeckoHealthRec( 1489): Recording search: google, bartext (15842, 2).
* Type something in the awesomebar, pick a search suggestion.
I/GeckoAwesomeBar( 1489): Recording search: amazondotcom, barsuggest
D/GeckoHealthRec( 1489): Recording search: amazondotcom, barsuggest (15842, 2).
* Sync a keyword search item, and type, e.g., "imdb shatner". (<https://support.mozilla.org/en-US/kb/how-search-from-address-bar>).
I/GeckoAwesomeBar( 1489): Recording search: null, barkeyword
D/GeckoHealthRec( 1489): Recording search: other, barkeyword (15842, 2).
After a pile of other patches land, you'll be able to see this stuff in your health report.
| Assignee | ||
Comment 7•13 years ago
|
||
This isn't perfect, because it duplicates some content from desktop.
I also *manually* added wikipedia, because I'm not sure why it's not in our partner list.
I'm sure binary search on this array isn't the most efficient way to do this, but it isn't too bad.
Attachment #751260 -
Flags: review?(nalexander)
| Assignee | ||
Comment 8•13 years ago
|
||
Rebased.
Attachment #751249 -
Attachment is obsolete: true
Attachment #751928 -
Flags: review+
| Assignee | ||
Comment 9•13 years ago
|
||
Rebased part 2.
Attachment #751260 -
Attachment is obsolete: true
Attachment #751260 -
Flags: review?(nalexander)
Attachment #751929 -
Flags: review?(nalexander)
| Assignee | ||
Comment 10•13 years ago
|
||
QA note: make sure the right thing happens when changing search defaults (Bug 730445).
| Assignee | ||
Updated•13 years ago
|
Blocks: new-about-home
| Assignee | ||
Updated•13 years ago
|
Priority: -- → P1
Comment 11•13 years ago
|
||
Comment on attachment 751929 [details] [diff] [review]
Part 2: limit search counts to partners. v2
Review of attachment 751929 [details] [diff] [review]:
-----------------------------------------------------------------
Not certain I'm the right person to review this, but it looks fine to me.
::: mobile/android/base/health/BrowserHealthRecorder.java
@@ +309,5 @@
> "bartext",
> };
>
> + // See services/healthreport/providers.jsm. Sorry for the duplication.
> + // THIS LIST MUST BE SORTED.
With what search order? Are all entries ASCII and sorted by C's strcmp or a particular ordering? For example, I see that '-' < 'd', which suggests binary ordering, e.g. strcmp.
Attachment #751929 -
Flags: review?(nalexander) → review+
| Assignee | ||
Comment 13•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7554b86cefc
https://hg.mozilla.org/integration/mozilla-inbound/rev/bcf9daabbccb
tracking-firefox23:
--- → ?
Target Milestone: --- → Firefox 24
Comment 14•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b7554b86cefc
https://hg.mozilla.org/mozilla-central/rev/bcf9daabbccb
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
status-firefox23:
--- → affected
| Assignee | ||
Comment 15•12 years ago
|
||
Comment on attachment 751928 [details] [diff] [review]
Proposed patch. v3
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
New work.
User impact if declined:
No FHR in 23.
Testing completed (on m-c, etc.):
Baking on m-c for some time. QA overview written up; waiting for QA to execute. Manual testing.
Risk to taking this patch (and alternatives if risky):
Slim; it's pretty robust against failures, and later patches improve that still further.
String or IDL/UUID changes made by this patch:
None.
Attachment #751928 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•12 years ago
|
Attachment #751929 -
Flags: approval-mozilla-aurora?
Updated•12 years ago
|
Attachment #751928 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 16•12 years ago
|
||
Comment on attachment 751929 [details] [diff] [review]
Part 2: limit search counts to partners. v2
Approving for uplift as part of the body of work for FHR's first revision on Android.
Attachment #751929 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
| Assignee | ||
Comment 17•12 years ago
|
||
Updated•7 years ago
|
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•