android-components / mozilla.components.service.glean / CommonMetricData

CommonMetricData

interface CommonMetricData (source)

This defines the common set of data shared across all the different metric types.

Properties

category

abstract val category: String

defaultStorageDestinations

abstract val defaultStorageDestinations: List<String>

Defines the names of the storages the metric defaults to when "default" is used as the destination storage. Note that every metric type will need to override this.

disabled

abstract val disabled: Boolean

lifetime

abstract val lifetime: Lifetime

name

abstract val name: String

sendInPings

abstract val sendInPings: List<String>

Functions

getStorageNames

open fun getStorageNames(): List<String>

Get the list of storage names the metric will record to. This automatically expands DEFAULT_STORAGE_NAME to the list of default storages for the metric.

shouldRecord

open fun shouldRecord(logger: Logger): Boolean

Inheritors

EventMetricType

data class EventMetricType : CommonMetricData

This implements the developer facing API for recording events.

StringMetricType

data class StringMetricType : CommonMetricData

This implements the developer facing API for recording string metrics.

UuidMetricType

data class UuidMetricType : CommonMetricData

This implements the developer facing API for recording uuids.