Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Uplift for 91: renew telemetry probes for August #20626

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
470 changes: 296 additions & 174 deletions app/metrics.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ sealed class Event {
object TabsTraySaveToCollectionPressed : Event()
object TabsTrayShareAllTabsPressed : Event()
object TabsTrayCloseAllTabsPressed : Event()
object TabsTrayCfrDismissed : Event()
object TabsTrayCfrTapped : Event()

object ProgressiveWebAppOpenFromHomescreenTap : Event()
object ProgressiveWebAppInstallAsShortcut : Event()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import org.mozilla.fenix.GleanMetrics.SyncedTabs
import org.mozilla.fenix.GleanMetrics.Tab
import org.mozilla.fenix.GleanMetrics.Tabs
import org.mozilla.fenix.GleanMetrics.TabsTray
import org.mozilla.fenix.GleanMetrics.TabsTrayCfr
import org.mozilla.fenix.GleanMetrics.Tip
import org.mozilla.fenix.GleanMetrics.ToolbarSettings
import org.mozilla.fenix.GleanMetrics.TopSites
Expand Down Expand Up @@ -700,12 +699,6 @@ private val Event.wrapper: EventWrapper<*>?
is Event.TabsTrayCloseAllTabsPressed -> EventWrapper<NoExtraKeys>(
{ TabsTray.closeAllTabs.record(it) }
)
is Event.TabsTrayCfrDismissed -> EventWrapper<NoExtraKeys>(
{ TabsTrayCfr.dismiss.record(it) }
)
is Event.TabsTrayCfrTapped -> EventWrapper<NoExtraKeys>(
{ TabsTrayCfr.goToSettings.record(it) }
)
is Event.AutoPlaySettingVisited -> EventWrapper<NoExtraKeys>(
{ Autoplay.visitedSetting.record(it) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ class TabsTrayFragment : AppCompatDialogFragment() {
store = requireComponents.core.store,
infoBannerView = view.info_banner,
settings = requireComponents.settings,
navigationInteractor = navigationInteractor,
metrics = requireComponents.analytics.metrics
navigationInteractor = navigationInteractor
),
owner = this,
view = view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import mozilla.components.lib.state.helpers.AbstractBinding
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.infobanner.InfoBanner
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.utils.Settings

@OptIn(ExperimentalCoroutinesApi::class)
Expand All @@ -31,8 +29,7 @@ class TabsTrayInfoBannerBinding(
store: BrowserStore,
private val infoBannerView: ViewGroup,
private val settings: Settings,
private val navigationInteractor: NavigationInteractor,
private val metrics: MetricController?
private val navigationInteractor: NavigationInteractor
) : AbstractBinding<BrowserState>(store) {

@VisibleForTesting
Expand Down Expand Up @@ -70,12 +67,10 @@ class TabsTrayInfoBannerBinding(
container = infoBannerView,
dismissByHiding = true,
dismissAction = {
metrics?.track(Event.TabsTrayCfrDismissed)
settings.shouldShowAutoCloseTabsBanner = false
}
) {
navigationInteractor.onTabSettingsClicked()
metrics?.track(Event.TabsTrayCfrTapped)
settings.shouldShowAutoCloseTabsBanner = false
}
} else {
Expand Down
2 changes: 0 additions & 2 deletions app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ class FenixApplicationTest {
assertEquals(true, Preferences.bookmarksSuggestion.testGetValue())
assertEquals(true, Preferences.clipboardSuggestionsEnabled.testGetValue())
assertEquals(true, Preferences.searchShortcutsEnabled.testGetValue())
assertEquals(true, Preferences.openLinksInPrivate.testGetValue())
assertEquals(true, Preferences.privateSearchSuggestions.testGetValue())
assertEquals(true, Preferences.voiceSearchEnabled.testGetValue())
assertEquals(true, Preferences.openLinksInAppEnabled.testGetValue())
assertEquals(true, Preferences.signedInSync.testGetValue())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.GleanMetrics.History
import org.mozilla.fenix.GleanMetrics.SyncedTabs
import org.mozilla.fenix.GleanMetrics.TabsTray
import org.mozilla.fenix.GleanMetrics.TabsTrayCfr
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner

@RunWith(FenixRobolectricTestRunner::class)
Expand Down Expand Up @@ -250,14 +249,6 @@ class GleanMetricsServiceTest {
assertFalse(TabsTray.closeAllTabs.testHasValue())
gleanService.track(Event.TabsTrayCloseAllTabsPressed)
assertTrue(TabsTray.closeAllTabs.testHasValue())

assertFalse(TabsTrayCfr.dismiss.testHasValue())
gleanService.track(Event.TabsTrayCfrDismissed)
assertTrue(TabsTrayCfr.dismiss.testHasValue())

assertFalse(TabsTrayCfr.goToSettings.testHasValue())
gleanService.track(Event.TabsTrayCfrTapped)
assertTrue(TabsTrayCfr.goToSettings.testHasValue())
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import mozilla.components.support.test.robolectric.testContext
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -41,6 +42,7 @@ class StorageStatsMetricsTest {
}

@Test
@Ignore("These metrics have expired.")
fun `WHEN reporting THEN the values from the storageStats are accumulated`() {
every { storageStats.appBytes } returns 100
every { storageStats.cacheBytes } returns 200
Expand All @@ -54,6 +56,7 @@ class StorageStatsMetricsTest {
}

@Test
@Ignore("These metrics have expired.")
fun `WHEN reporting THEN the query duration is measured`() {
StorageStatsMetrics.reportSync(mockContext)
assertTrue(Metrics.queryStatsDuration.testHasValue())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
import org.mozilla.fenix.tabstray.TabsTrayInfoBannerBinding.Companion.TAB_COUNT_SHOW_CFR
import org.mozilla.fenix.utils.Settings
Expand All @@ -35,7 +33,6 @@ class TabsTrayInfoBannerBindingTest {
private lateinit var store: BrowserStore
private lateinit var view: ViewGroup
private lateinit var interactor: NavigationInteractor
private lateinit var metrics: MetricController
private lateinit var settings: Settings

@get:Rule
Expand All @@ -46,7 +43,6 @@ class TabsTrayInfoBannerBindingTest {
store = BrowserStore()
view = CoordinatorLayout(testContext)
interactor = mockk(relaxed = true)
metrics = mockk(relaxed = true)
settings = Settings(testContext)
}

Expand All @@ -60,8 +56,7 @@ class TabsTrayInfoBannerBindingTest {
store = store,
infoBannerView = view,
settings = settings,
navigationInteractor = interactor,
metrics = metrics
navigationInteractor = interactor
)

binding.start()
Expand All @@ -88,8 +83,7 @@ class TabsTrayInfoBannerBindingTest {
store = store,
infoBannerView = view,
settings = settings,
navigationInteractor = interactor,
metrics = metrics
navigationInteractor = interactor
)

binding.start()
Expand All @@ -103,7 +97,5 @@ class TabsTrayInfoBannerBindingTest {

verify(exactly = 0) { interactor.onTabSettingsClicked() }
assert(!settings.shouldShowAutoCloseTabsBanner)
verify(exactly = 0) { metrics.track(Event.TabsTrayCfrTapped) }
verify(exactly = 1) { metrics.track(Event.TabsTrayCfrDismissed) }
}
}