From 71e838598436292b08bf1dc678d49dd07d1364d4 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Fri, 22 Nov 2024 16:20:10 +0000 Subject: [PATCH] Bug 1929832 - Rename to `usage-reporting` ping and remove the info fields r=loines,android-reviewers,pollymce This is done for Desktop, Fenix and Focus all at once Differential Revision: https://phabricator.services.mozilla.com/D229785 --- browser/modules/metrics.yaml | 4 +- mobile/android/fenix/app/metrics.yaml | 1 + mobile/android/fenix/app/pings.yaml | 20 ++++++++++ .../org/mozilla/fenix/FenixApplication.kt | 2 +- mobile/android/focus-android/app/pings.yaml | 19 ++++++++++ .../focus/telemetry/GleanMetricsService.kt | 2 +- toolkit/components/glean/pings.yaml | 1 + toolkit/components/telemetry/metrics.yaml | 2 +- toolkit/components/telemetry/pings.yaml | 20 ++++++++++ .../tests/client/test_fog_dau_reporting.py | 12 +++--- .../tests/client/test_fog_user_activity.py | 37 +++++++++++++------ 11 files changed, 96 insertions(+), 24 deletions(-) diff --git a/browser/modules/metrics.yaml b/browser/modules/metrics.yaml index e6e5ed0b1551..c4c0f62b388d 100644 --- a/browser/modules/metrics.yaml +++ b/browser/modules/metrics.yaml @@ -42,7 +42,7 @@ browser.engagement: send_in_pings: - baseline - metrics - - dau-reporting + - usage-reporting telemetry_mirror: BROWSER_ENGAGEMENT_ACTIVE_TICKS no_lint: - BASELINE_PING @@ -75,7 +75,7 @@ browser.engagement: send_in_pings: - baseline - metrics - - dau-reporting + - usage-reporting no_lint: - BASELINE_PING telemetry_mirror: BROWSER_ENGAGEMENT_TOTAL_URI_COUNT_NORMAL_AND_PRIVATE_MODE diff --git a/mobile/android/fenix/app/metrics.yaml b/mobile/android/fenix/app/metrics.yaml index 41ec96900262..5d7c83adee60 100644 --- a/mobile/android/fenix/app/metrics.yaml +++ b/mobile/android/fenix/app/metrics.yaml @@ -2114,6 +2114,7 @@ metrics: send_in_pings: - metrics - baseline + - usage-reporting bugs: - https://github.com/mozilla-mobile/fenix/issues/16075 data_reviews: diff --git a/mobile/android/fenix/app/pings.yaml b/mobile/android/fenix/app/pings.yaml index 005a2c19d77c..a754dc9c07af 100644 --- a/mobile/android/fenix/app/pings.yaml +++ b/mobile/android/fenix/app/pings.yaml @@ -131,3 +131,23 @@ dau-reporting: active: | The ping was submitted when the application became active again, which includes when the application starts. + +usage-reporting: + description: | + Minimal ping to measure the usage frequency of Firefox. + Sent on the baseline schedule. + include_client_id: false + send_if_empty: true + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1929832 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + notification_emails: + - glean-team@mozilla.com + - jrediger@mozilla.com + - loines@mozilla.com + metadata: + include_info_sections: false + ping_schedule: + - baseline diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index ee484cdb4252..50f9227f49c6 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -212,7 +212,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { delayPingLifetimeIo = FxNimbus.features.glean.value().delayPingLifetimeIo, pingLifetimeThreshold = FxNimbus.features.glean.value().pingLifetimeThreshold, pingLifetimeMaxTime = FxNimbus.features.glean.value().pingLifetimeMaxTime, - pingSchedule = mapOf("baseline" to listOf("dau-reporting")), + pingSchedule = mapOf("baseline" to listOf("usage-reporting")), ) // Set the metric configuration from Nimbus. diff --git a/mobile/android/focus-android/app/pings.yaml b/mobile/android/focus-android/app/pings.yaml index 47aa785ad057..5a55b61bf972 100644 --- a/mobile/android/focus-android/app/pings.yaml +++ b/mobile/android/focus-android/app/pings.yaml @@ -56,3 +56,22 @@ dau-reporting: active: | The ping was submitted when the application became active again, which includes when the application starts. + +usage-reporting: + description: | + Minimal ping to measure the usage frequency of Firefox. + Sent on the baseline schedule. + include_client_id: false + send_if_empty: true + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + notification_emails: + - glean-team@mozilla.com + - jrediger@mozilla.com + - loines@mozilla.com + metadata: + include_info_sections: false + ping_schedule: + - baseline diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/telemetry/GleanMetricsService.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/telemetry/GleanMetricsService.kt index d35cb236e10b..e4998c405067 100644 --- a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/telemetry/GleanMetricsService.kt +++ b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/telemetry/GleanMetricsService.kt @@ -112,7 +112,7 @@ class GleanMetricsService(context: Context) : MetricsService { client = lazy(LazyThreadSafetyMode.NONE) { components.client }, usePrivateRequest = true, ), - pingSchedule = mapOf("baseline" to listOf("dau-reporting")), + pingSchedule = mapOf("baseline" to listOf("usage-reporting")), ), buildInfo = GleanBuildInfo.buildInfo, ) diff --git a/toolkit/components/glean/pings.yaml b/toolkit/components/glean/pings.yaml index 69923152a621..cdaf651d9b24 100644 --- a/toolkit/components/glean/pings.yaml +++ b/toolkit/components/glean/pings.yaml @@ -23,6 +23,7 @@ dau-reporting: send_if_empty: true bugs: - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1929832 data_reviews: - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 notification_emails: diff --git a/toolkit/components/telemetry/metrics.yaml b/toolkit/components/telemetry/metrics.yaml index e04f0b862c85..c0836f20e4bd 100644 --- a/toolkit/components/telemetry/metrics.yaml +++ b/toolkit/components/telemetry/metrics.yaml @@ -105,7 +105,7 @@ usage: - loines@mozilla.com expires: never send_in_pings: - - dau-reporting + - usage-reporting browser.engagement: session_time_including_suspend: diff --git a/toolkit/components/telemetry/pings.yaml b/toolkit/components/telemetry/pings.yaml index d99e19d66b08..fbac52769314 100644 --- a/toolkit/components/telemetry/pings.yaml +++ b/toolkit/components/telemetry/pings.yaml @@ -4,3 +4,23 @@ --- $schema: moz://mozilla.org/schemas/glean/pings/2-0-0 + +usage-reporting: + description: | + Minimal ping to measure the usage frequency of Firefox. + Sent on the baseline schedule. + include_client_id: false + send_if_empty: true + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1929832 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1921440 + notification_emails: + - glean-team@mozilla.com + - jrediger@mozilla.com + - loines@mozilla.com + metadata: + include_info_sections: false + ping_schedule: + - baseline diff --git a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_dau_reporting.py b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_dau_reporting.py index d30871b44cb9..22f8bbc9fd22 100644 --- a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_dau_reporting.py +++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_dau_reporting.py @@ -8,16 +8,16 @@ from telemetry_harness.fog_ping_filters import ( ) from telemetry_harness.fog_testcase import FOGTestCase -FOG_DAU_REPORTING = FOGDocTypePingFilter("dau-reporting") +FOG_DAU_REPORTING = FOGDocTypePingFilter("usage-reporting") CANARY_USAGE_PROFILE_ID = "beefbeef-beef-beef-beef-beeefbeefbee" class TestDauReporting(FOGTestCase): - """Tests for FOG dau-reporting ping and dau-id cycling.""" + """Tests for FOG usage-reporting ping and dau-id cycling.""" def test_dau_reporting(self): """ - Test the "dau-reporting" ping behaviour and dau-id cycling when disabling telemetry. + Test the "usage-reporting" ping behaviour and dau-id cycling when disabling telemetry. """ ping1 = self.wait_for_ping( @@ -26,10 +26,8 @@ class TestDauReporting(FOGTestCase): ping_server=self.fog_ping_server, ) - self.assertIn("ping_info", ping1["payload"]) - self.assertIn("client_info", ping1["payload"]) - - self.assertNotIn("client_id", ping1["payload"]["client_info"]) + self.assertNotIn("ping_info", ping1["payload"]) + self.assertNotIn("client_info", ping1["payload"]) metrics = ping1["payload"]["metrics"] self.assertNotIn("legacy.telemetry.client_id", metrics["uuid"]) diff --git a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_user_activity.py b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_user_activity.py index 4ceb1dc4420c..34fa3a377030 100644 --- a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_user_activity.py +++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_user_activity.py @@ -16,22 +16,35 @@ class BaselineRidealongFilter: return doc_type in self.expected_pings -DauReportFilter = BaselineRidealongFilter("dau-reporting") +DauReportFilter = BaselineRidealongFilter("usage-reporting") class TestClientActivity(FOGTestCase): """ Tests for client activity and FOG's scheduling of the "baseline" ping. - For every `baseline` ping we also expect a `dau-reporting` ping. + For every `baseline` ping we also expect a `usage-reporting` ping. """ def test_user_activity(self): + # We might still get those pings in an unexpected order. + # Let's check we get both. + expected_pings = ["baseline", "usage-reporting"] + # First test that restarting the browser sends a "active" ping [ping0, ping1] = self.wait_for_pings( self.restart_browser, DauReportFilter, 2, ping_server=self.fog_ping_server ) - self.assertEqual("active", ping0["payload"]["ping_info"]["reason"]) - self.assertEqual("active", ping1["payload"]["ping_info"]["reason"]) + received_pings = sorted( + [ + ping0["request_url"]["doc_type"], + ping1["request_url"]["doc_type"], + ] + ) + self.assertEqual(expected_pings, received_pings) + if ping0["request_url"]["doc_type"] == "baseline": + self.assertEqual("active", ping0["payload"]["ping_info"]["reason"]) + if ping1["request_url"]["doc_type"] == "baseline": + self.assertEqual("active", ping1["payload"]["ping_info"]["reason"]) with self.marionette.using_context(self.marionette.CONTEXT_CHROME): zero_prefs_script = """\ @@ -61,10 +74,6 @@ class TestClientActivity(FOGTestCase): ping_server=self.fog_ping_server, ) - # We might still get those pings in an unexpected order. - # Let's check we get both. - expected_pings = ["baseline", "dau-reporting"] - received_pings = sorted( [ ping2["request_url"]["doc_type"], @@ -72,8 +81,10 @@ class TestClientActivity(FOGTestCase): ] ) self.assertEqual(expected_pings, received_pings) - self.assertEqual("active", ping2["payload"]["ping_info"]["reason"]) - self.assertEqual("active", ping3["payload"]["ping_info"]["reason"]) + if ping2["request_url"]["doc_type"] == "baseline": + self.assertEqual("active", ping2["payload"]["ping_info"]["reason"]) + if ping3["request_url"]["doc_type"] == "baseline": + self.assertEqual("active", ping3["payload"]["ping_info"]["reason"]) received_pings = sorted( [ @@ -82,5 +93,7 @@ class TestClientActivity(FOGTestCase): ] ) self.assertEqual(expected_pings, received_pings) - self.assertEqual("inactive", ping4["payload"]["ping_info"]["reason"]) - self.assertEqual("inactive", ping5["payload"]["ping_info"]["reason"]) + if ping4["request_url"]["doc_type"] == "baseline": + self.assertEqual("inactive", ping4["payload"]["ping_info"]["reason"]) + if ping5["request_url"]["doc_type"] == "baseline": + self.assertEqual("inactive", ping5["payload"]["ping_info"]["reason"])