android-components / mozilla.components.service.glean.private / StringMetricType

StringMetricType

data class StringMetricType : CommonMetricData (source)

This implements the developer facing API for recording string metrics.

Instances of this class type are automatically generated by the parsers at build time, allowing developers to record values that were previously registered in the metrics.yaml file.

The string API only exposes the set method, which takes care of validating the input data and making sure that limits are enforced.

Constructors

Name Summary
<init> StringMetricType(disabled: Boolean, category: String, lifetime: Lifetime, name: String, sendInPings: List<String>)
This implements the developer facing API for recording string metrics.

Properties

Name Summary
category val category: String
disabled val disabled: Boolean
lifetime val lifetime: Lifetime
name val name: String
sendInPings val sendInPings: List<String>

Inherited Properties

Name Summary
identifier open val identifier: String

Functions

Name Summary
set fun set(value: String): Unit
Set a string value.
testGetValue fun testGetValue(pingName: String = sendInPings.first()): String
Returns the stored value for testing purposes only. This function will attempt to await the last task (if any) writing to the the metric’s storage engine before returning a value.
testHasValue fun testHasValue(pingName: String = sendInPings.first()): Boolean
Tests whether a value is stored for the metric for testing purposes only. This function will attempt to await the last task (if any) writing to the the metric’s storage engine before returning a value.

Inherited Functions

Name Summary
shouldRecord open fun shouldRecord(logger: Logger): Boolean