Bug 1499193 - Follow-up 2: Update SEARCH_COUNTS key r=mkaply

Change the `<engine>.<alias>.urlbar` `SEARCH_COUNTS` keys to `<engine>.alias` as described in bug 1499193 comment 23 and later.

Differential Revision: https://phabricator.services.mozilla.com/D12038

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Drew Willcoxon 2018-11-16 21:15:54 +00:00
Родитель 2f82c64173
Коммит b8258389b8
3 изменённых файлов: 8 добавлений и 19 удалений

Просмотреть файл

@ -423,7 +423,7 @@ let BrowserUsageTelemetry = {
* true if this event was generated by a one-off search. * true if this event was generated by a one-off search.
* @param {Boolean} [details.isSuggestion=false] * @param {Boolean} [details.isSuggestion=false]
* true if this event was generated by a suggested search. * true if this event was generated by a suggested search.
* @param {Boolean} [details.alias=null] * @param {String} [details.alias=null]
* The search engine alias used in the search, if any. * The search engine alias used in the search, if any.
* @param {Object} [details.type=null] * @param {Object} [details.type=null]
* The object describing the event that triggered the search. * The object describing the event that triggered the search.
@ -459,8 +459,7 @@ let BrowserUsageTelemetry = {
if (details.alias && if (details.alias &&
engine.wrappedJSObject._internalAliases.includes(details.alias)) { engine.wrappedJSObject._internalAliases.includes(details.alias)) {
let aliasCountId = let aliasCountId = getSearchEngineId(engine) + ".alias";
[getSearchEngineId(engine), details.alias, source].join(".");
histogram.add(aliasCountId); histogram.add(aliasCountId);
} }
} }

Просмотреть файл

@ -181,9 +181,7 @@ add_task(async function test_simpleQuery() {
// Make sure SEARCH_COUNTS contains identical values. // Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
// Also check events. // Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
@ -238,9 +236,7 @@ add_task(async function test_searchAlias() {
// Make sure SEARCH_COUNTS contains identical values. // Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
// Also check events. // Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
@ -281,9 +277,7 @@ add_task(async function test_internalSearchAlias() {
await p; await p;
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); checkKeyedHistogram(search_hist, "other-MozSearch.alias", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
info("Search using the other internal search alias."); info("Search using the other internal search alias.");
p = BrowserTestUtils.browserLoaded(tab.linkedBrowser); p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
@ -292,9 +286,7 @@ add_task(async function test_internalSearchAlias() {
await p; await p;
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2); checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2);
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); checkKeyedHistogram(search_hist, "other-MozSearch.alias", 2);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", 1);
BrowserTestUtils.removeTab(tab); BrowserTestUtils.removeTab(tab);
}); });
@ -330,9 +322,7 @@ add_task(async function test_oneOff_enter() {
// Make sure SEARCH_COUNTS contains identical values. // Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
// Also check events. // Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);

Просмотреть файл

@ -8032,7 +8032,7 @@
"releaseChannelCollection": "opt-out", "releaseChannelCollection": "opt-out",
"alert_emails": ["adw@mozilla.com"], "alert_emails": ["adw@mozilla.com"],
"bug_numbers": [1089670, 1482158, 1499193], "bug_numbers": [1089670, 1482158, 1499193],
"description": "Records search counts for search access points and in content searches. For search access points in general and for the urlbar when an internal @engine shorcut is not used, the format is: <engine-name>.<search-access-point> For the urlbar when an internal @engine shortcut is used, the format is: <engine-name>.<@engine>.urlbar For in content searches, the format is <provider>.in-content:[sap|sap-follow-on|organic]:[code|none]" "description": "Records search counts for search access points and in content searches. For search access points in general and for the urlbar when an internal @engine shorcut is not used, the format is: <engine-name>.<search-access-point> For the urlbar when an internal @engine shortcut is used, the format is: <engine-name>.alias For in content searches, the format is <provider>.in-content:[sap|sap-follow-on|organic]:[code|none]"
}, },
"SEARCH_RESET_RESULT": { "SEARCH_RESET_RESULT": {
"record_in_processes": ["main", "content"], "record_in_processes": ["main", "content"],