Bug 1836165 - New growth telemetry for private tab open count

fenix/116.0
Harrison Oglesby 12 months ago committed by mergify[bot]
parent 584ffcff9d
commit f8d6ec5758

@ -2238,6 +2238,30 @@ metrics:
tags:
- Discovery
- Search
private_tabs_open_count:
type: counter
lifetime: application
description: |
A counter that indicates how many PRIVATE tabs a user has open. This
value will only be set if the user has at least *one* open tab. If they
have 0, this ping will not get sent, resulting in a null value. To
disambiguate between a failed `private_tabs_open_count` ping and 0 open tabs,
please see `has_open_tabs`
send_in_pings:
- metrics
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1836165
data_reviews:
- https://github.com/mozilla-mobile/firefox-android/pull/2427
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- cgordon@mozilla.com
expires: never
metadata:
tags:
- Tabs
tabs_open_count:
type: counter
lifetime: application

@ -725,6 +725,11 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
tabsOpenCount.add(openTabsCount)
}
val openPrivateTabsCount = settings.openPrivateTabsCount
if (openPrivateTabsCount > 0) {
privateTabsOpenCount.add(openPrivateTabsCount)
}
val topSitesSize = settings.topSitesSize
hasTopSites.set(topSitesSize > 0)
if (topSitesSize > 0) {

@ -13,6 +13,7 @@ import mozilla.components.browser.state.action.TabListAction
import mozilla.components.browser.state.selector.findTab
import mozilla.components.browser.state.selector.findTabOrCustomTab
import mozilla.components.browser.state.selector.normalTabs
import mozilla.components.browser.state.selector.privateTabs
import mozilla.components.browser.state.state.BrowserState
import mozilla.components.browser.state.state.SessionState
import mozilla.components.concept.base.crash.CrashReporting
@ -94,6 +95,7 @@ class TelemetryMiddleware(
-> {
// Update/Persist tabs count whenever it changes
settings.openTabsCount = context.state.normalTabs.count()
settings.openPrivateTabsCount = context.state.privateTabs.count()
if (context.state.normalTabs.isNotEmpty()) {
Metrics.hasOpenTabs.set(true)
} else {

@ -1324,6 +1324,11 @@ class Settings(private val appContext: Context) : PreferencesHolder {
0,
)
var openPrivateTabsCount by intPreference(
appContext.getPreferenceKey(R.string.pref_key_open_private_tabs_count),
0,
)
var mobileBookmarksSize by intPreference(
appContext.getPreferenceKey(R.string.pref_key_mobile_bookmarks_size),
0,

@ -276,6 +276,7 @@
<string name="pref_key_debug_settings" translatable="false">pref_key_debug_settings</string>
<string name="pref_key_open_tabs_count" translatable="false">pref_key_open_tabs_count</string>
<string name="pref_key_open_private_tabs_count" translatable="false">pref_key_open_private_tabs_count</string>
<!-- Add-on Metrics Values -->
<string name="pref_key_installed_addons_count" translatable="false">pref_key_installed_addons_count</string>

Loading…
Cancel
Save