Bug 1923028 - Migrate scalars to use Glean APIs for findbar.*, r=chutten.

Depends on D225366

Differential Revision: https://phabricator.services.mozilla.com/D225367
This commit is contained in:
Florian Quèze
2024-10-16 20:46:07 +00:00
parent 1d371b8a8e
commit d36d6d0734
2 changed files with 120 additions and 7 deletions

View File

@@ -382,3 +382,116 @@ security.ui.tlserror:
The status of the failed channel, as an nsresult.
type: quantity
telemetry_mirror: SecurityUiTlserror_Load_Abouttlserror
findbar:
shown:
type: counter
description: >
The count of how many times the "Find toolbar" was shown per
session.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.shown.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_SHOWN
find_prev:
type: counter
description: >
The count of how many times the find previous button was used per
session.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.find_prev.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_FIND_PREV
find_next:
type: counter
description: >
The count of how many times the find next button was used per
session.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.find_next.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_FIND_NEXT
highlight_all:
type: counter
description: >
The count of how many times the "Highlight All" button was used in
find toolbar.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.highlight_all.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_HIGHLIGHT_ALL
match_case:
type: counter
description: >
The count of how many times the "Match Case" button was used in find
toolbar.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.match_case.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_MATCH_CASE
match_diacritics:
type: counter
description: >
The count of how many times the "Match Diacritics" button was used
in find toolbar.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.match_diacritics.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_MATCH_DIACRITICS
whole_words:
type: counter
description: >
The count of how many times the "Whole Words" button was used in
find toolbar.
This metric was generated to correspond to the Legacy Telemetry
scalar findbar.whole_words.
bugs:
- https://bugzil.la/1627688
data_reviews:
- https://bugzil.la/1627688
notification_emails:
- rtestard@mozilla.com
expires: never
telemetry_mirror: FINDBAR_WHOLE_WORDS

View File

@@ -534,7 +534,7 @@
if (highlight !== this._highlightAll) {
this._highlightAll = highlight;
if (!fromPrefObserver) {
Services.telemetry.scalarAdd("findbar.highlight_all", 1);
Glean.findbar.highlightAll.add(1);
Services.prefs.setBoolPref("findbar.highlightAll", highlight);
}
}
@@ -592,7 +592,7 @@
this._find();
this._dispatchFindEvent("casesensitivitychange");
Services.telemetry.scalarAdd("findbar.match_case", 1);
Glean.findbar.matchCase.add(1);
}
/**
@@ -646,7 +646,7 @@
this._dispatchFindEvent("diacriticmatchingchange");
Services.telemetry.scalarAdd("findbar.match_diacritics", 1);
Glean.findbar.matchDiacritics.add(1);
}
/**
@@ -682,7 +682,7 @@
// Just set the pref; our observer will change the find bar behavior.
Services.prefs.setBoolPref("findbar.entireword", entireWord);
Services.telemetry.scalarAdd("findbar.whole_words", 1);
Glean.findbar.wholeWords.add(1);
return;
}
@@ -709,7 +709,7 @@
this._updateFindUI();
if (this.hidden) {
Services.telemetry.scalarAdd("findbar.shown", 1);
Glean.findbar.shown.add(1);
this.removeAttribute("noanim");
this.hidden = false;
@@ -1176,9 +1176,9 @@
*/
onFindAgainCommand(findPrevious) {
if (findPrevious) {
Services.telemetry.scalarAdd("findbar.find_prev", 1);
Glean.findbar.findPrev.add(1);
} else {
Services.telemetry.scalarAdd("findbar.find_next", 1);
Glean.findbar.findNext.add(1);
}
let findString =