Skip to content

Commit

Permalink
For mozilla-mobile#960 - Adds metrics to measure if Fenix is the defa…
Browse files Browse the repository at this point in the history
…ult browser
  • Loading branch information
boek committed Mar 22, 2019
1 parent 0acf869 commit d42a15c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file defines the metrics that are recorded by glean telemetry. They are
# automatically converted to Kotlin code at build time using the `glean_parser`
# PyPI package.

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

metrics:
default_browser:
type: boolean
description: >
Is Fenix the default browser?
send_in_pings:
- metrics
bugs:
- 123456789
data_reviews:
- N/A
notification_emails:
- telemetry-client-dev@mozilla.com
expires: never
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ package org.mozilla.fenix.components.metrics

import android.content.Context
import mozilla.components.service.glean.Glean
import mozilla.components.support.utils.Browsers
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.utils.Settings
import org.mozilla.fenix.debug.GleanMetrics.Metrics

class GleanMetricsService(private val context: Context) : MetricsService {
override fun start() {
Glean.initialize(context)
Glean.setUploadEnabled(IsGleanEnabled)

Metrics.apply {
defaultBrowser.set(Browsers.all(context).isDefaultBrowser)
}
}

override fun track(event: Event) { }
Expand Down

0 comments on commit d42a15c

Please sign in to comment.