[Meta] Add telemetry for page persistence
Spinning off from https://github.com/mozilla-mobile/android-components/issues/9366#issuecomment-772628773
I think something that would be interesting to track is:
- number of times the user switches to a tab and
- the tab is not loaded
- the tab is loaded
- number of times the user taps on the app and
- fenix cold starts
- fenix warm starts but tab is not loaded
- fenix warm starts and tab is loaded
- number of times we receive onTrimMemory and
- we ignore it
- we unload tabs (and how many)
- what level
- number of times we get killed in the background using
onKill(for content process) andgetHistoricalProcessExitReasonsfor main process https://developer.android.com/reference/kotlin/android/app/ActivityManager#gethistoricalprocessexitreasons (API30 only I think)- number of alive tabs when
- going to background
- going back to foreground and how long we've been backgrounded (so we can plot tab retention with 1,5,10,30 minutes)
This metrics could help us track how memory/performance affects retaining tabs/getting killed and how often our users get their tabs reloaded. Also it can help us know how many tabs are actually alive in users devices (e.g. when thinking about memory/performance tradeoffs based on number of tabs)
┆Issue is synchronized with this Jira Task
We are thinking the priority of these probes are as follows:
- number of times the user taps on the app and fenix warm starts but tab is not loaded
- number of alive tabs when * going to background * going back to foreground and how long we've been backgrounded (so we can plot tab retention with 1,5,10,30 minutes)
- number of times we receive onTrimMemory and we unload tabs (and how many)
- .... the others
After discussion with @pocmo it was determined that it is not possible to collect the information regarding cold and warm starts
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1796483
Change performed by the Move to Bugzilla add-on.