Bug 1671508 - Convert some urlbar histograms to scalars. r=harry

This converts FX_URLBAR_SELECTED_RESULT_TYPE_2, FX_URLBAR_SELECTED_RESULT_INDEX
and the correlation between them FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2 to
keyed scalars, that are nicer to use and analyze.

They are converted to one keyed scalar per result type, tracking the number
of times that type was picked per urlbar index.
The sums (count per type or per index) can still be derived from this structure.

Differential Revision: https://phabricator.services.mozilla.com/D94498
This commit is contained in:
Marco Bonardo 2020-10-27 11:36:15 +00:00
parent 05c2cbb42e
commit 5a339a3ea6
13 changed files with 523 additions and 205 deletions

View File

@ -530,86 +530,42 @@ class UrlbarController {
// Do not modify existing telemetry types. To add a new type:
//
// * Set telemetryType appropriately below.
// * Add the type to UrlbarUtils.SELECTED_RESULT_TYPES.
// * See n_values in Histograms.json for FX_URLBAR_SELECTED_RESULT_TYPE_2
// and FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2. If your new type causes
// the number of types to become larger than n_values, you'll need to
// replace these histograms with new ones. See "Changing a histogram" in
// the histogram telemetry doc for more.
// * Set telemetryType appropriately. Since telemetryType is used as the
// probe name, it must be alphanumeric with optional underscores.
// * Add a new keyed scalar probe into the urlbar.picked category for the
// newly added telemetryType.
// * Add a test named browser_UsageTelemetry_urlbar_newType.js to
// browser/modules/test/browser.
let telemetryType;
switch (result.type) {
case UrlbarUtils.RESULT_TYPE.TAB_SWITCH:
telemetryType = "switchtab";
break;
case UrlbarUtils.RESULT_TYPE.SEARCH:
if (result.source == UrlbarUtils.RESULT_SOURCE.HISTORY) {
telemetryType = "formhistory";
} else if (result.providerName == "TabToSearch") {
telemetryType = "tabtosearch";
} else {
telemetryType = result.payload.suggestion
? "searchsuggestion"
: "searchengine";
}
break;
case UrlbarUtils.RESULT_TYPE.URL:
if (result.autofill) {
telemetryType = "autofill";
} else if (
result.source == UrlbarUtils.RESULT_SOURCE.OTHER_LOCAL &&
result.heuristic
) {
telemetryType = "visiturl";
} else {
telemetryType =
result.source == UrlbarUtils.RESULT_SOURCE.BOOKMARKS
? "bookmark"
: "history";
}
break;
case UrlbarUtils.RESULT_TYPE.KEYWORD:
telemetryType = "keyword";
break;
case UrlbarUtils.RESULT_TYPE.OMNIBOX:
telemetryType = "extension";
break;
case UrlbarUtils.RESULT_TYPE.REMOTE_TAB:
telemetryType = "remotetab";
break;
case UrlbarUtils.RESULT_TYPE.TIP:
telemetryType = "tip";
break;
case UrlbarUtils.RESULT_TYPE.DYNAMIC:
telemetryType = "dynamic";
break;
default:
Cu.reportError(`Unknown Result Type ${result.type}`);
return;
}
// The "topsite" type overrides the above ones, because it starts from a
// unique user interaction, that we want to count apart.
if (result.providerName == "UrlbarProviderTopSites") {
telemetryType = "topsite";
}
//
// The "topsite" type overrides the other ones, because it starts from a
// unique user interaction, that we want to count apart. We do this here
// rather than in telemetryTypeFromResult because other consumers, like
// events telemetry, are reporting this information separately.
let telemetryType =
result.providerName == "UrlbarProviderTopSites"
? "topsite"
: UrlbarUtils.telemetryTypeFromResult(result);
Services.telemetry.keyedScalarAdd(
`urlbar.picked.${telemetryType}`,
resultIndex,
1
);
// These histograms should be removed after a deprecation time where we'll
// confirm goodness of the new scalar above.
if (!(telemetryType in UrlbarUtils.SELECTED_RESULT_TYPES)) {
Cu.reportError(`Unsupported telemetry type ${telemetryType}`);
return;
}
Services.telemetry
.getHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX")
.add(resultIndex);
if (telemetryType in UrlbarUtils.SELECTED_RESULT_TYPES) {
Services.telemetry
.getHistogramById("FX_URLBAR_SELECTED_RESULT_TYPE_2")
.add(UrlbarUtils.SELECTED_RESULT_TYPES[telemetryType]);
Services.telemetry
.getKeyedHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2")
.add(telemetryType, resultIndex);
} else {
Cu.reportError(
"Unknown FX_URLBAR_SELECTED_RESULT_TYPE_2 type: " + telemetryType
);
}
Services.telemetry
.getHistogramById("FX_URLBAR_SELECTED_RESULT_TYPE_2")
.add(UrlbarUtils.SELECTED_RESULT_TYPES[telemetryType]);
Services.telemetry
.getKeyedHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2")
.add(telemetryType, resultIndex);
}
/**
@ -796,9 +752,9 @@ class TelemetryEvent {
* @param {string} details.selIndex Index of the selected result, undefined
* for "blur".
* @param {string} details.selType type of the selected element, undefined
* for "blur". One of "none", "autofill", "visit", "bookmark",
* "history", "keyword", "search", "searchsuggestion", "switchtab",
* "remotetab", "extension", "oneoff".
* for "blur". One of "unknown", "autofill", "visiturl", "bookmark",
* "history", "keyword", "searchengine", "searchsuggestion",
* "switchtab", "remotetab", "extension", "oneoff".
* @param {string} details.provider The name of the provider for the selected
* result.
* @note event can be null, that usually happens for paste&go or drop&go.
@ -911,7 +867,7 @@ class TelemetryEvent {
}
/**
* Extracts a type from an element, to be used in the telemetry event.
* Extracts a telemetry type from an element for event telemetry.
* @param {Element} element The element to analyze.
* @returns {string} a string type for the telemetry event.
*/
@ -920,43 +876,16 @@ class TelemetryEvent {
return "none";
}
let row = element.closest(".urlbarView-row");
if (row.result) {
switch (row.result.type) {
case UrlbarUtils.RESULT_TYPE.TAB_SWITCH:
return "switchtab";
case UrlbarUtils.RESULT_TYPE.SEARCH:
if (row.result.source == UrlbarUtils.RESULT_SOURCE.HISTORY) {
return "formhistory";
}
if (row.result.providerName == "TabToSearch") {
return "tabtosearch";
}
return row.result.payload.suggestion ? "searchsuggestion" : "search";
case UrlbarUtils.RESULT_TYPE.URL:
if (row.result.autofill) {
return "autofill";
}
if (row.result.heuristic) {
return "visit";
}
return row.result.source == UrlbarUtils.RESULT_SOURCE.BOOKMARKS
? "bookmark"
: "history";
case UrlbarUtils.RESULT_TYPE.KEYWORD:
return "keyword";
case UrlbarUtils.RESULT_TYPE.OMNIBOX:
return "extension";
case UrlbarUtils.RESULT_TYPE.REMOTE_TAB:
return "remotetab";
case UrlbarUtils.RESULT_TYPE.TIP:
if (element.classList.contains("urlbarView-tip-help")) {
return "tiphelp";
}
return "tip";
case UrlbarUtils.RESULT_TYPE.DYNAMIC:
return "dynamic";
if (row.result && row.result.providerName != "UrlbarProviderTopSites") {
// Element handlers go here.
if (
row.result.type == UrlbarUtils.RESULT_TYPE.TIP &&
element.classList.contains("urlbarView-tip-help")
) {
return "tiphelp";
}
}
return "none";
// Now handle the result.
return UrlbarUtils.telemetryTypeFromResult(row.result);
}
}

View File

@ -902,7 +902,7 @@ class UrlbarInput {
this.handleRevert();
this.controller.engagementEvent.record(event, {
selIndex,
numChars: this._lastSearchString.length,
searchString: this._lastSearchString,
selType: this.controller.engagementEvent.typeFromElement(element),
provider: result.providerName,
});

View File

@ -119,7 +119,7 @@ var UrlbarUtils = {
visiturl: 8,
remotetab: 9,
extension: 10,
"preloaded-top-site": 11,
"preloaded-top-site": 11, // This is currently unused.
tip: 12,
topsite: 13,
formhistory: 14,
@ -912,6 +912,62 @@ var UrlbarUtils = {
);
});
},
/**
* Extracts a telemetry type from a result, used by scalars and event
* telemetry.
*
* @param {UrlbarResult} result The result to analyze.
* @returns {string} A string type for telemetry.
* @note New types should be added to Scalars.yaml under the urlbar.picked
* category and documented in the in-tree documentation. A data-review
* is always necessary.
*/
telemetryTypeFromResult(result) {
if (!result) {
return "unknown";
}
switch (result.type) {
case UrlbarUtils.RESULT_TYPE.TAB_SWITCH:
return "switchtab";
case UrlbarUtils.RESULT_TYPE.SEARCH:
if (result.source == UrlbarUtils.RESULT_SOURCE.HISTORY) {
return "formhistory";
}
if (result.providerName == "TabToSearch") {
return "tabtosearch";
}
return result.payload.suggestion ? "searchsuggestion" : "searchengine";
case UrlbarUtils.RESULT_TYPE.URL:
if (result.autofill) {
return "autofill";
}
if (
result.source == UrlbarUtils.RESULT_SOURCE.OTHER_LOCAL &&
result.heuristic
) {
return "visiturl";
}
return result.source == UrlbarUtils.RESULT_SOURCE.BOOKMARKS
? "bookmark"
: "history";
case UrlbarUtils.RESULT_TYPE.KEYWORD:
return "keyword";
case UrlbarUtils.RESULT_TYPE.OMNIBOX:
return "extension";
case UrlbarUtils.RESULT_TYPE.REMOTE_TAB:
return "remotetab";
case UrlbarUtils.RESULT_TYPE.TIP:
return "tip";
case UrlbarUtils.RESULT_TYPE.DYNAMIC:
if (result.providerName == "TabToSearch") {
// This is the onboarding result.
return "tabtosearch";
}
return "dynamic";
}
return "unknown";
},
};
XPCOMUtils.defineLazyGetter(UrlbarUtils.ICON, "DEFAULT", () => {

View File

@ -46,40 +46,6 @@ FX_URLBAR_SELECTED_RESULT_METHOD
Before QuantumBar, it was possible to right-click a result to highlight but
not pick it. Then the user could press Enter. This is no more possible.
FX_URLBAR_SELECTED_RESULT_INDEX
This probe tracks the indexes of picked results in the results list.
It's an enumerated histogram with 17 buckets.
FX_URLBAR_SELECTED_RESULT_TYPE_2
This probe tracks the types of picked results.
It's an enumerated histogram with 32 buckets.
Values can be:
0. autofill
1. bookmark
2. history
3. keyword
4. searchengine
5. searchsuggestion
6. switchtab
7. tag
8. visiturl
9. remotetab
10. extension
11. preloaded-top-site
12. tip
13. topsite
14. formhistory
FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2
This probe tracks picked result type, for each one it tracks the index where
it appeared.
It's a keyed histogram where the keys are result types (see
`UrlbarUtils.SELECTED_RESULT_TYPES`_). For each key, this records the indexes
of picked results for that result type.
.. _UrlbarUtils.SELECTED_RESULT_TYPES: https://searchfox.org/mozilla-central/search?q=symbol:UrlbarUtils%23SELECTED_RESULT_TYPES&redirect=false
Scalars
-------
@ -146,7 +112,7 @@ urlbar.tips
Incremented when the redirect search tip is shown.
urlbar.searchmode.*
This is set of keyed scalars whose values are uints are are incremented each
This is a set of keyed scalars whose values are uints incremented each
time search mode is entered in the Urlbar. The suffix on the scalar name
describes how search mode was entered. Possibilities include:
@ -198,6 +164,53 @@ urlbar.searchmode.*
Wikipedia sites (Wikipedia (en), Wikipedia (fr), etc.) to "Wikipedia". This
is done to reduce the number of keys used by these scalars.
urlbar.picked.*
This is a set of keyed scalars whose values are uints incremented each
time a result is picked from the Urlbar. The suffix on the scalar name
is the result type. The keys for the scalars above are the 0-based index of
the result in the urlbar panel when it was picked.
.. note::
Available from Firefox 84 on. Use the *FX_URLBAR_SELECTED_** histograms in
earlier versions. See the `Obsolete probes`_ section below.
Valid result types are:
- ``autofill``
An origin or a URL completed the user typed text inline.
- ``bookmark``
A bookmarked URL.
- ``dynamic``
A specially crafted result, often used in experiments when basic types are
not flexible enough for a rich layout.
- ``extension``
Added by an add-on through the omnibox WebExtension API.
- ``formhistory``
A search suggestion from previous search history.
- ``history``
A URL from history.
- ``keyword``
A bookmark keyword.
- ``remotetab``
A tab synced from another device.
- ``searchengine``
A search result, but not a suggestion. May be the default search action
or a search alias.
- ``searchsuggestion``
A remote search suggestion.
- ``switchtab``
An open tab.
- ``tabtosearch``
A tab to search result.
- ``tip``
A tip result.
- ``topsite``
An entry from top sites.
- ``unknown``
An unknown result type, a bug should be filed to figure out what it is.
- ``visiturl``
The user typed string can be directly visited.
Event Telemetry
---------------
@ -270,10 +283,11 @@ Event Extra
- ``selType``
The type of the selected result at the time of submission.
This is only present for ``engagement`` events.
It can be one of: ``none``, ``autofill``, ``visit``, ``bookmark``,
``history``, ``keyword``, ``search``, ``searchsuggestion``, ``switchtab``,
``remotetab``, ``extension``, ``oneoff``, ``keywordoffer``, ``canonized``,
``tip``, ``tiphelp``, ``formhistory``, ``tabtosearch``
It can be one of: ``none``, ``autofill``, ``visiturl``, ``bookmark``,
``history``, ``keyword``, ``searchengine``, ``searchsuggestion``,
``switchtab``, ``remotetab``, ``extension``, ``oneoff``, ``keywordoffer``,
``canonized``, ``tip``, ``tiphelp``, ``formhistory``, ``tabtosearch``,
``unknown``
In practice, ``tabtosearch`` should not appear in real event telemetry.
Opening a tab-to-search result enters search mode and entering search mode
does not currently mark the end of an engagement. It is noted here for
@ -363,14 +377,13 @@ Obsolete probes
Obsolete histograms
~~~~~~~~~~~~~~~~~~~
FX_URLBAR_SELECTED_RESULT_TYPE (OBSOLETE)
This probe is obsolete and was replaced with
``FX_URLBAR_SELECTED_RESULT_TYPE_2`` in Firefox 78 in order to increase the
number of buckets.
FX_URLBAR_SELECTED_RESULT_INDEX (OBSOLETE)
This probe tracked the indexes of picked results in the results list.
It was an enumerated histogram with 17 buckets.
FX_URLBAR_SELECTED_RESULT_TYPE and FX_URLBAR_SELECTED_RESULT_TYPE_2 (from Firefox 78 on) (OBSOLETE)
This probe tracked the types of picked results.
It's an enumerated histogram with 14 buckets.
Values can be:
It was an enumerated histogram with 17 buckets:
0. autofill
1. bookmark
@ -386,20 +399,17 @@ FX_URLBAR_SELECTED_RESULT_TYPE (OBSOLETE)
11. preloaded-top-site
12. tip
13. topsite
14. formhistory
15. dynamic
16. tabtosearch
FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE (OBSOLETE)
This probe is obsolete and was replaced with
``FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2`` in Firefox 78 in order to
increase the number of buckets.
This probe tracked picked result type, for each one it tracks the index where
FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE and FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2 (from Firefox 78 on) (OBSOLETE)
This probe tracked picked result type, for each one it tracked the index where
it appeared.
It's a keyed histogram where the keys are result types (see
`UrlbarUtils.SELECTED_RESULT_TYPES`_). For each key, this records the indexes
It was a keyed histogram where the keys were result types (see
FX_URLBAR_SELECTED_RESULT_TYPE above). For each key, this recorded the indexes
of picked results for that result type.
.. _UrlbarUtils.SELECTED_RESULT_TYPES: https://searchfox.org/mozilla-central/search?q=symbol:UrlbarUtils%23SELECTED_RESULT_TYPES&redirect=false
Obsolete search probes
----------------------

View File

@ -55,7 +55,7 @@ const tests = [
numChars: "1",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -82,7 +82,7 @@ const tests = [
numChars: "17",
numWords: "3",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -110,7 +110,7 @@ const tests = [
numChars: "4",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -191,7 +191,7 @@ const tests = [
numChars: "4",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -273,7 +273,7 @@ const tests = [
numChars: "4",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -298,7 +298,7 @@ const tests = [
numChars: "1",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -648,7 +648,7 @@ const tests = [
numChars: "3",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -700,7 +700,7 @@ const tests = [
numChars: "3",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -999,7 +999,7 @@ const tests = [
elapsed: val => parseInt(val) > 0,
numChars: "6",
numWords: "1",
selType: "search",
selType: "searchengine",
selIndex: "0",
provider: "HeuristicFallback",
},
@ -1045,7 +1045,7 @@ const tests = [
numChars: "3",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -1112,7 +1112,7 @@ const tests = [
numChars: "3",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -1139,7 +1139,7 @@ const tests = [
numChars: "1",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};
@ -1186,7 +1186,7 @@ const tests = [
elapsed: val => parseInt(val) > 0,
numChars: "6",
numWords: "1",
selType: "search",
selType: "searchengine",
selIndex: "0",
provider: "HeuristicFallback",
},
@ -1233,7 +1233,7 @@ const tests = [
elapsed: val => parseInt(val) > 0,
numChars: "1",
numWords: "1",
selType: "search",
selType: "searchengine",
selIndex: "0",
provider: "HeuristicFallback",
},
@ -1262,7 +1262,7 @@ const tests = [
numChars: "1",
numWords: "1",
selIndex: "0",
selType: "search",
selType: "searchengine",
provider: "HeuristicFallback",
},
};

View File

@ -99,7 +99,7 @@ add_task(async function test() {
EventUtils.synthesizeKey("KEY_Enter")
);
assertHistogramResults(
assertTelemetryResults(
histograms,
"dynamic",
0,
@ -129,7 +129,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -146,4 +146,11 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}

View File

@ -68,7 +68,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -85,6 +85,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
add_task(async function setup() {
@ -162,7 +169,7 @@ add_task(async function test_extension() {
EventUtils.synthesizeKey("KEY_Enter");
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"extension",
0,

View File

@ -83,7 +83,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -100,6 +100,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
add_task(async function setup() {
@ -167,7 +174,7 @@ add_task(async function test_history() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"history",
1,
@ -198,7 +205,7 @@ add_task(async function test_bookmark() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"bookmark",
1,
@ -224,7 +231,7 @@ add_task(async function test_keyword() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"keyword",
0,
@ -253,7 +260,7 @@ add_task(async function test_switchtab() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"switchtab",
1,
@ -278,7 +285,7 @@ add_task(async function test_visitURL() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"visiturl",
0,
@ -312,7 +319,7 @@ add_task(async function test_autofill() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"autofill",
0,

View File

@ -70,7 +70,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -87,6 +87,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
add_task(async function setup() {
@ -194,7 +201,7 @@ add_task(async function test_remotetab() {
await p;
assertSearchTelemetryEmpty(histograms.search_hist);
assertHistogramResults(
assertTelemetryResults(
histograms,
"remotetab",
1,

View File

@ -37,7 +37,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -54,6 +54,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
add_task(async function setup() {
@ -61,6 +68,7 @@ add_task(async function setup() {
set: [
["browser.urlbar.update2", true],
["browser.urlbar.update2.tabToComplete", true],
["browser.urlbar.tabToSearch.onboard.maxShown", 0],
],
});
@ -119,7 +127,7 @@ add_task(async function test() {
entry: "tabtosearch",
});
assertHistogramResults(
assertTelemetryResults(
histograms,
"tabtosearch",
1,

View File

@ -35,7 +35,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -52,6 +52,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
add_task(async function setup() {
@ -102,7 +109,7 @@ add_task(async function test() {
});
EventUtils.synthesizeKey("KEY_Enter");
assertHistogramResults(
assertTelemetryResults(
histograms,
"tip",
0,

View File

@ -36,7 +36,7 @@ function snapshotHistograms() {
};
}
function assertHistogramResults(histograms, type, index, method) {
function assertTelemetryResults(histograms, type, index, method) {
TelemetryTestUtils.assertHistogram(histograms.resultIndexHist, index, 1);
TelemetryTestUtils.assertHistogram(
@ -53,6 +53,13 @@ function assertHistogramResults(histograms, type, index, method) {
);
TelemetryTestUtils.assertHistogram(histograms.resultMethodHist, method, 1);
TelemetryTestUtils.assertKeyedScalar(
TelemetryTestUtils.getProcessScalars("parent", true, true),
`urlbar.picked.${type}`,
index,
1
);
}
/**
@ -131,7 +138,7 @@ add_task(async function test() {
EventUtils.synthesizeKey("KEY_Enter");
await loadPromise;
assertHistogramResults(
assertTelemetryResults(
histograms,
"topsite",
0,

View File

@ -5461,6 +5461,279 @@ urlbar:
record_in_processes:
- main
urlbar.picked:
autofill:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
bookmark:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
dynamic:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
extension:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
formhistory:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
history:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
keyword:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
remotetab:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
searchengine:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
searchsuggestion:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
switchtab:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
tabtosearch:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
tip:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
topsite:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
unknown:
bug_numbers:
- 1671508
description: >
Counts how many times an unknown result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
visiturl:
bug_numbers:
- 1671508
description: >
Counts how many times this result type was picked at a given index.
expires: never
kind: uint
keyed: true
notification_emails:
- fx-search@mozilla.com
- tbrooks@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- main
urlbar.searchmode:
bookmarkmenu:
bug_numbers: