For #18426: warn about flaw in `app_opened_all_startup` probe.

upstream-sync
Michael Comella 3 years ago committed by Michael Comella
parent ade38246be
commit ac34432176

@ -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.
<br><br>
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.

@ -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(

@ -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)|<ul><li>error_type: The error type of the error page encountered</li></ul>|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)|<ul><li>source: The method used to open Fenix. Possible values are: `app_icon`, `custom_tab` or `link` </li></ul>|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)|<ul><li>first_frame_pre_draw_nanos: 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 not be reported. </li><li>has_saved_instance_state: boolean value whether or not startup type has a savedInstance. using savedInstance, HomeActivity's previous state can be restored. This is an optional key since it is not applicable to all the cases. 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]. </li><li>source: The method used to open Fenix. Possible values are `app_icon`, `custom_tab`, `link` or `unknown`. unknown is for startup sources where we can't pinpoint the cause. One UNKNOWN case is the app switcher where we don't know what variables to check to ensure this startup wasn't caused by something else. </li><li>type: the startup type for opening fenix. the application and HomeActivity either needs to be created or started again. possible values are `cold`, `warm`, `hot` or `error`. Error is for impossible cases. Please file a bug if you see the error case. app created AND HomeActivity created = cold app started AND HomeActivity created = warm app started AND HomeActivity started = hot app created AND HomeActivity started = error Some applications such as gmail launches the default browser in the background. So when we eventually click a link, browser is already started in the background. This means that custom_tab will mostly report `warm` startup type. </li></ul>|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. <br><br> 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)|<ul><li>first_frame_pre_draw_nanos: 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 not be reported. </li><li>has_saved_instance_state: boolean value whether or not startup type has a savedInstance. using savedInstance, HomeActivity's previous state can be restored. This is an optional key since it is not applicable to all the cases. 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]. </li><li>source: The method used to open Fenix. Possible values are `app_icon`, `custom_tab`, `link` or `unknown`. unknown is for startup sources where we can't pinpoint the cause. One UNKNOWN case is the app switcher where we don't know what variables to check to ensure this startup wasn't caused by something else. </li><li>type: the startup type for opening fenix. the application and HomeActivity either needs to be created or started again. possible values are `cold`, `warm`, `hot` or `error`. Error is for impossible cases. Please file a bug if you see the error case. app created AND HomeActivity created = cold app started AND HomeActivity created = warm app started AND HomeActivity started = hot app created AND HomeActivity started = error Some applications such as gmail launches the default browser in the background. So when we eventually click a link, browser is already started in the background. This means that custom_tab will mostly report `warm` startup type. </li></ul>|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)|<ul><li>source: The method used to open Fenix. Possible values are `app_icon`, `custom_tab`, `link` or `unknown` </li></ul>|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)|<ul><li>item: A string containing the name of the item the user tapped. These items include: Settings, Help, Desktop Site toggle on/off, Find in Page, New Tab, Private Tab, Share, Report Site Issue, Back/Forward button, Reload Button, Quit, Reader Mode On, Reader Mode Off, Open In app, Add To Top Sites, Add-ons Manager, Bookmarks, History </li></ul>|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 |

Loading…
Cancel
Save