Closed Bug 1367125 Opened 7 years ago Closed 7 years ago

Record search cohort using the new annotation API

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: gfritzsche, Assigned: brennan.brisad, Mentored)

Details

(Whiteboard: [lang=js])

Attachments

(1 file)

In bug 1348748, we implemented a new API to properly annotate the different experiments in the environment data.

An interesting data point to add to this is the "search cohort".

This lists relevant code:
https://dxr.mozilla.org/mozilla-central/search?q=path%3Atoolkit%2Fcomponents%2Ftelemetry%2F+searchCohort&redirect=false

The relevant test is run using:
./mach toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js

The experiment annotation API is documented here:
https://gecko.readthedocs.io/en/latest/toolkit/components/telemetry/telemetry/collection/index.html#experiment-annotation

For this bug we need to:
- Cu.import() TelemetryEnvironment.jsm into Experiments.jsm
- use the annotation API to mark the search cohort
- add test coverage
- do a simple manual test of the changes (i will detail this later after the rest works)
Summary: Telemetry Experiments should use new annotation API → Search cohort should use the new annotation API
Summary: Search cohort should use the new annotation API → Record search cohort using the new annotation API
(In reply to Georg Fritzsche [:gfritzsche] from comment #0)
> For this bug we need to:
> - Cu.import() TelemetryEnvironment.jsm into Experiments.jsm

Strike that, we just need to use the annotations API inside TelemetryEnvironment.jsm.
Florian, is the pref "browser.search.cohort" still actively used?
Flags: needinfo?(florian)
(In reply to Georg Fritzsche [:gfritzsche] from comment #2)
> Florian, is the pref "browser.search.cohort" still actively used?

Yes, I think so. Or if it's not actively used currently, it's likely to be in the future. We use this preference whenever we are testing a new potential default search engine in a specific geography. Mike Kaply can tell you more about it if needed.
Flags: needinfo?(florian)
Thanks.
Alejandro, do you want to take this bug?
Flags: needinfo?(alexrs95)
(In reply to Georg Fritzsche [:gfritzsche] from comment #4)
> Thanks.
> Alejandro, do you want to take this bug?

Yes, I'll work on it.
Flags: needinfo?(alexrs95)
Assignee: nobody → alexrs95
Yes, we definitely still actively use this.
This is currently free to work on.
Assignee: alexrs95 → nobody
Hi, I'd like to work on this one.
Sure, great!
Do you need any further information on this?
Assignee: nobody → brennan.brisad
Flags: needinfo?(brennan.brisad)
Great!
Yes, I wonder if have I understood this correctly.
That is, I need to add methods to TelemetryEnvironment which will set and unset the searchCohort, and then add tests to test_TelemetryEnvironment.js.

Is that correct?
Flags: needinfo?(brennan.brisad)
Flags: needinfo?(chutten)
Mostly correct! Near as I can tell you need only annotate the experiment information[1] with the searchCohort whenever that information is changed in TelemetryEnvironment's _updateSearchEngine function[2].

Does this make sense?

(Sorry for the long time between replies. When asking a question of a specific person we use the "Need more information from" field to make sure the question isn't missed in the bulk of bugmail we receive :S )

[1]: https://gecko.readthedocs.io/en/latest/toolkit/components/telemetry/telemetry/collection/experiments.html
[2]: https://dxr.mozilla.org/mozilla-central/search?q=_updateSearchEngine&redirect=true
Flags: needinfo?(chutten) → needinfo?(brennan.brisad)
Thanks Chris,

This clarifies things, but I still wonder if I got it right.  I see that the `_updateSearchEngine` function does already set a searchCohort[1] under settings.  But with my updated understanding we should also set the searchCohort to be part of an experiment, with `TelemetryEnvironment.setExperimentActive('searchCohort', <value>)`.  Is that accurate?

Sorry for the delay, despite the needinfo, I had missed it but got a reminding email :-)

[1]: https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/TelemetryEnvironment.jsm#1182
Flags: needinfo?(brennan.brisad) → needinfo?(chutten)
No worries. That is my understanding as well: have the searchCohort be an experiment.

Then you will need to add a test to ensure that it is set properly (and, if it changes, that it updates properly and we don't see two experiments with the same name or anything else strange)
Flags: needinfo?(chutten)
Attached patch bug1367125.patchSplinter Review
Attachment #8886890 - Flags: feedback?(gfritzsche)
Comment on attachment 8886890 [details] [diff] [review]
bug1367125.patch

Review of attachment 8886890 [details] [diff] [review]:
-----------------------------------------------------------------

Chris, can you take a look here?
Attachment #8886890 - Flags: feedback?(gfritzsche) → feedback?(chutten)
Comment on attachment 8886890 [details] [diff] [review]
bug1367125.patch

Review of attachment 8886890 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me!
Attachment #8886890 - Flags: review+
Attachment #8886890 - Flags: feedback?(chutten)
Attachment #8886890 - Flags: feedback+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7514d624a816
Record search cohort using the new annotation API. r=gfritzsche
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7514d624a816
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: