Bug 1567302 - add a Telemetry ping to record the deault setting of blocking autoplay. r=janerik,daleharvey

We acutally have an old Telemetry ping `autoplay_default_blocked`, which, however, has been removed incorrectly in bug1356046.

As we have extended the setting options of blocking autoplay in bug1543812, it's also no longer proper to use scalar to store it.

Therefore, create an new histogram Telemetry ping to store the number of times a user changed the default autoplay behavior to each setting during a subsession.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alastor Wu 2019-08-09 21:26:55 +00:00
Родитель 3194a92923
Коммит 9f6ad187bb
2 изменённых файлов: 22 добавлений и 2 удалений

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

@ -1691,8 +1691,14 @@ BrowserGlue.prototype = {
},
_updateAutoplayPref() {
let blocked = Services.prefs.getIntPref("media.autoplay.default", 1);
Services.telemetry.scalarSet("media.autoplay_default_blocked", blocked);
const blocked = Services.prefs.getIntPref("media.autoplay.default", 1);
const telemetry = Services.telemetry.getHistogramById(
"AUTOPLAY_DEFAULT_SETTING_CHANGE"
);
const labels = { 0: "allow", 1: "blockAudible", 5: "blockAll" };
if (blocked in labels) {
telemetry.add(labels[blocked]);
}
},
_setPrefExpectations() {

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

@ -15360,6 +15360,20 @@
"description": "How long the AudioContext would become audible since it was created, time unit is seconds.",
"releaseChannelCollection": "opt-out"
},
"AUTOPLAY_DEFAULT_SETTING_CHANGE": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],
"alert_emails": [
"alwu@mozilla.com",
"nohlmeier@mozilla.com"
],
"expires_in_version": "74",
"kind": "categorical",
"labels": ["allow", "blockAudible", "blockAll"],
"bug_numbers": [1567302],
"description": "counts the number of times a user changed the default autoplay behavior to each setting during a subsession.",
"releaseChannelCollection": "opt-out"
},
"WEB_AUDIO_AUTOPLAY": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],