diff --git a/app/metrics.yaml b/app/metrics.yaml index f5c10fb5b..11cab2585 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -52,9 +52,9 @@ events: for example, when we are doing a hot start up, we cant have a savedInstanceState therefore we report only [APP_ICON, HOT] instead of [APP_ICON, HOT, false]. - launch_time_nano_seconds: + first_frame_pre_draw_nanos: description: | - the number of nano seconds application took to launch. This is the + the number of nanoseconds the application took to launch. This is the time difference between application launch(user pressing app_icon, launching a link) and until the first view is about to be drawn on the screen. If the time is not captured, this extra key will diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index f8a3089ea..aec8008f1 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -356,7 +356,7 @@ sealed class Event { hasSavedInstanceState.toString() } if (launchTime != null) { - extrasMap[Events.appOpenedAllStartupKeys.launchTimeNanoSeconds] = + extrasMap[Events.appOpenedAllStartupKeys.firstFramePreDrawNanos] = launchTime.toString() } return extrasMap diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/AppStartupTelemetryTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/AppStartupTelemetryTest.kt index b7f515e7f..41449a310 100644 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/AppStartupTelemetryTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/metrics/AppStartupTelemetryTest.kt @@ -19,10 +19,10 @@ import org.junit.Before import org.junit.Test import org.junit.Assert.assertTrue import org.mozilla.fenix.GleanMetrics.Events +import org.mozilla.fenix.GleanMetrics.Events.appOpenedAllStartupKeys.firstFramePreDrawNanos import org.mozilla.fenix.GleanMetrics.Events.appOpenedAllStartupKeys.hasSavedInstanceState import org.mozilla.fenix.GleanMetrics.Events.appOpenedAllStartupKeys.source import org.mozilla.fenix.GleanMetrics.Events.appOpenedAllStartupKeys.type -import org.mozilla.fenix.GleanMetrics.Events.appOpenedAllStartupKeys.launchTimeNanoSeconds import org.mozilla.fenix.components.metrics.Event.AppAllStartup import org.mozilla.fenix.components.metrics.Event.AppAllStartup.Source import org.mozilla.fenix.components.metrics.Event.AppAllStartup.Source.APP_ICON @@ -272,7 +272,7 @@ class AppStartupTelemetryTest { val expectedExtra: Map? = hashMapOf( source to APP_ICON.toString(), type to HOT.toString(), - launchTimeNanoSeconds to onPreDrawTime.minus(homeActivityInitTime).toString()) + firstFramePreDrawNanos to onPreDrawTime.minus(homeActivityInitTime).toString()) val appAllStartup = AppAllStartup(APP_ICON, HOT, launchTime = onPreDrawTime.minus(homeActivityInitTime)) @@ -285,7 +285,7 @@ class AppStartupTelemetryTest { source to APP_ICON.toString(), type to COLD.toString(), hasSavedInstanceState to true.toString(), - launchTimeNanoSeconds to onPreDrawTime.minus(homeActivityInitTime).toString()) + firstFramePreDrawNanos to onPreDrawTime.minus(homeActivityInitTime).toString()) val appAllStartup = AppAllStartup(APP_ICON, COLD, true, onPreDrawTime.minus(homeActivityInitTime)) diff --git a/docs/metrics.md b/docs/metrics.md index 0fb94284a..6ba26840c 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -99,7 +99,7 @@ The following metrics are added to the ping: | download_notification.try_again |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on try again when a download fails in the download notification |[1](https://github.com/mozilla-mobile/fenix/pull/6554), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 | | error_page.visited_error |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user encountered an error page |[1](https://github.com/mozilla-mobile/fenix/pull/2491#issuecomment-492414486), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 | | events.app_opened |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the app (from cold start, to the homescreen or browser) |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 | -| events.app_opened_all_startup |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the app to the HomeActivity. The HomeActivity encompasses the home screen, browser screen, settings screen, collections and other screens in the nav_graph. This differs from the app_opened probe because it measures all startups, not just cold startup. Note: There is a short gap between the time application goes into background and the time android reports the application going into the background. Note: This metric does not record souce when app opened from task switcher: open application -> press home button -> open recent tasks -> choose fenix. In this case will report [source = unknown, type = hot, has_saved_instance_state = false]. |[1](https://github.com/mozilla-mobile/fenix/pull/12114#pullrequestreview-445245341), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [3](https://github.com/mozilla-mobile/fenix/pull/13494#pullrequestreview-474050499)||2021-06-01 |2 | +| events.app_opened_all_startup |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the app to the HomeActivity. The HomeActivity encompasses the home screen, browser screen, settings screen, collections and other screens in the nav_graph. This differs from the app_opened probe because it measures all startups, not just cold startup. Note: There is a short gap between the time application goes into background and the time android reports the application going into the background. Note: This metric does not record souce when app opened from task switcher: open application -> press home button -> open recent tasks -> choose fenix. In this case will report [source = unknown, type = hot, has_saved_instance_state = false]. |[1](https://github.com/mozilla-mobile/fenix/pull/12114#pullrequestreview-445245341), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [3](https://github.com/mozilla-mobile/fenix/pull/13494#pullrequestreview-474050499)||2021-06-01 |2 | | events.app_received_intent |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The system received an Intent for the HomeActivity. An intent is received an external entity wants to the app to display content. Intents can be received when the app is closed – at which point the app will be opened – or when the app is already opened – at which point the already open app will make changes such as loading a url. This can be used loosely as a heuristic for when the user requested to open the app. The HomeActivity encompasses the home screen and browser screen but may include other screens. This differs from the app_opened probe because it measures all startups, not just cold startup. |[1](https://github.com/mozilla-mobile/fenix/pull/11940/), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-06-01 | | | events.browser_menu_action |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A browser menu item was tapped |[1](https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708), [2](https://github.com/mozilla-mobile/fenix/pull/5098#issuecomment-529658996), [3](https://github.com/mozilla-mobile/fenix/pull/6310), [4](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 | | events.entered_url |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user entered a url |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 |