diff --git a/app/metrics.yaml b/app/metrics.yaml index 5b835aa41..5989de5d1 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -11,6 +11,12 @@ events: app_opened_all_startup: type: event description: | + **This probe has a known flaw:** for COLD start up, it doesn't take into + account if the process is already running when the app starts, possibly + inflating results (e.g. a Service started the process 20min ago and only + now is HomeActivity launching). See the `cold_*_app_to_first_frame` probes + for a replacement. +

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. diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/AppStartupTelemetry.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/AppStartupTelemetry.kt index dc3411304..333fda67f 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/AppStartupTelemetry.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/AppStartupTelemetry.kt @@ -33,6 +33,12 @@ import java.lang.reflect.Modifier.PRIVATE * Sample = [source = COLD, type = APP_ICON, hasSavedInstanceState = false,launchTimeNanoSeconds = 1824000000] * The basic idea is to collect these metrics from different phases of startup through * [AppAllStartup] and finally report them on Activity's onResume() function. + * + * **THIS CLASS HAS A KNOWN FLAW:** for COLD start, it doesn't take into account if the process is + * already running when the app starts, possibly inflating results (e.g. a Service started the + * process 20min ago and only now is HomeActivity launching). Future telemetry implementations should + * probably move in the ideological direction of [org.mozilla.fenix.perf.ColdStartupDurationTelemetry]: + * simplicity rather than comprehensiveness. */ @Suppress("TooManyFunctions") class AppStartupTelemetry( diff --git a/docs/metrics.md b/docs/metrics.md index cef175232..d0afcd95b 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -128,7 +128,7 @@ In addition to those built-in metrics, the following metrics are added to the pi | downloads_misc.download_added |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A counter for how many times something is downloaded in the app. |[mozilla-mobile/fenix#16730](https://github.com/mozilla-mobile/fenix/pull/16730), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)||2021-07-01 | | | error_page.visited_error |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user encountered an error page |[mozilla-mobile/fenix#2491](https://github.com/mozilla-mobile/fenix/pull/2491#issuecomment-492414486), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)||2021-07-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) |[mozilla-mobile/fenix#1067](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)||2021-07-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]. |[mozilla-mobile/fenix#12114](https://github.com/mozilla-mobile/fenix/pull/12114#pullrequestreview-445245341), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#13494](https://github.com/mozilla-mobile/fenix/pull/13494#pullrequestreview-474050499), [mozilla-mobile/fenix#15605](https://github.com/mozilla-mobile/fenix/pull/15605#issuecomment-702365594)||2021-06-01 |2 | +| events.app_opened_all_startup |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |**This probe has a known flaw:** for COLD start up, it doesn't take into account if the process is already running when the app starts, possibly inflating results (e.g. a Service started the process 20min ago and only now is HomeActivity launching). See the `cold_*_app_to_first_frame` probes for a replacement.

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]. |[mozilla-mobile/fenix#12114](https://github.com/mozilla-mobile/fenix/pull/12114#pullrequestreview-445245341), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#13494](https://github.com/mozilla-mobile/fenix/pull/13494#pullrequestreview-474050499), [mozilla-mobile/fenix#15605](https://github.com/mozilla-mobile/fenix/pull/15605#issuecomment-702365594)||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. |[mozilla-mobile/fenix#11940/](https://github.com/mozilla-mobile/fenix/pull/11940/), [mozilla-mobile/fenix#13958](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 |[mozilla-mobile/fenix#1214](https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708), [mozilla-mobile/fenix#5098](https://github.com/mozilla-mobile/fenix/pull/5098#issuecomment-529658996), [mozilla-mobile/fenix#6310](https://github.com/mozilla-mobile/fenix/pull/6310), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)||2021-07-01 |2 | | events.copy_url_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |An event that indicates that a user has selected copy option when long pressing on url bar. |[mozilla-mobile/fenix#16915](https://github.com/mozilla-mobile/fenix/pull/16915)||2021-05-10 |2 |