Bug 1803363 - Mirror ExtensionDNR glean distribution metrics into unified telemetry histograms. r=robwu

Differential Revision: https://phabricator.services.mozilla.com/D174029
This commit is contained in:
Luca Greco 2023-04-05 10:36:13 +00:00
parent f8f68c580c
commit cd75d02610
3 changed files with 35 additions and 2 deletions

View File

@ -152,6 +152,7 @@ extensions.apis.dnr:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1803363#c11
data_sensitivity:
- technical
telemetry_mirror: WEBEXT_DNR_EVALUATE_RULES_MS
evaluate_rules_count_max:
type: quantity

View File

@ -1550,6 +1550,8 @@ add_task(async function test_static_rules_telemetry() {
},
{
metric: "evaluateRulesTime",
mirroredName: "WEBEXT_DNR_EVALUATE_RULES_MS",
mirroredType: "histogram",
},
],
"before test extension have been loaded"
@ -1678,7 +1680,14 @@ add_task(async function test_static_rules_telemetry() {
await assertDNRGetEnabledRulesets(extension, ["ruleset1"]);
assertDNRTelemetryMetricsNoSamples(
[{ metric: "evaluateRulesTime" }, { metric: "evaluateRulesCountMax" }],
[
{
metric: "evaluateRulesTime",
mirroredName: "WEBEXT_DNR_EVALUATE_RULES_MS",
mirroredType: "histogram",
},
{ metric: "evaluateRulesCountMax" },
],
"before any request have been intercepted"
);
@ -1689,7 +1698,14 @@ add_task(async function test_static_rules_telemetry() {
);
assertDNRTelemetryMetricsNoSamples(
[{ metric: "evaluateRulesTime" }, { metric: "evaluateRulesCountMax" }],
[
{
metric: "evaluateRulesTime",
mirroredName: "WEBEXT_DNR_EVALUATE_RULES_MS",
mirroredType: "histogram",
},
{ metric: "evaluateRulesCountMax" },
],
"after restricted request have been intercepted (but no rules evaluated)"
);
@ -1714,6 +1730,8 @@ add_task(async function test_static_rules_telemetry() {
[
{
metric: "evaluateRulesTime",
mirroredName: "WEBEXT_DNR_EVALUATE_RULES_MS",
mirroredType: "histogram",
expectedSamplesCount: expectedEvaluateRulesTimeSamples,
},
],
@ -1740,6 +1758,8 @@ add_task(async function test_static_rules_telemetry() {
[
{
metric: "evaluateRulesTime",
mirroredName: "WEBEXT_DNR_EVALUATE_RULES_MS",
mirroredType: "histogram",
expectedSamplesCount: expectedEvaluateRulesTimeSamples,
},
],

View File

@ -15796,6 +15796,18 @@
"description": "The number of times a browserAction popup is preloaded and results in one of the categories, keyed by addon id.",
"keyed": true
},
"WEBEXT_DNR_EVALUATE_RULES_MS": {
"record_in_processes": ["main"],
"products": ["firefox"],
"alert_emails": ["addons-dev-internal@mozilla.com"],
"bug_numbers": [1803363],
"expires_in_version": "120",
"kind": "exponential",
"releaseChannelCollection": "opt-out",
"high": 100000,
"n_buckets": 100,
"description": "Amount of time it takes to evaluate DNR rules."
},
"WEBEXT_DNR_STARTUPCACHE_READ_BYTES": {
"record_in_processes": ["main"],
"products": ["firefox"],