glean / mozilla.telemetry.glean / GleanInternalAPI

GleanInternalAPI

open class GleanInternalAPI

The main Glean API.

This is exposed through the global Glean object.

Functions

getUploadEnabled

fun getUploadEnabled(): Boolean

Get whether or not Glean is allowed to record and upload data.

initialize

fun initialize(applicationContext: Context, uploadEnabled: Boolean, configuration: Configuration = Configuration()): Unit
fun initialize(applicationContext: Context, uploadEnabled: Boolean, configuration: Configuration = Configuration(), buildInfo: BuildInfo): Unit

Initialize the Glean SDK.

registerPings

fun registerPings(pings: Any): Unit

Register the pings generated from pings.yaml with the Glean SDK.

setExperimentActive

fun setExperimentActive(experimentId: String, branch: String, extra: Map<String, String>? = null): Unit

Indicate that an experiment is running. Glean will then add an experiment annotation to the environment which is sent with pings. This information is not persisted between runs.

setExperimentInactive

fun setExperimentInactive(experimentId: String): Unit

Indicate that an experiment is no longer running.

setUploadEnabled

fun setUploadEnabled(enabled: Boolean): Unit

Enable or disable Glean collection and upload.

testGetExperimentData

fun testGetExperimentData(experimentId: String): RecordedExperimentData

Returns the stored data for the requested active experiment, for testing purposes only.

testIsExperimentActive

fun testIsExperimentActive(experimentId: String): Boolean

Tests whether an experiment is active, for testing purposes only.

Inheritors

Glean

object Glean : GleanInternalAPI

The main Glean object.