Expand description
Glean is a modern approach for recording and sending Telemetry data.
It’s in use at Mozilla.
All documentation can be found online:
§The Glean SDK Book
§Example
Initialize Glean, register a ping and then send it.
let cfg = ConfigurationBuilder::new(true, "/tmp/data", "org.mozilla.glean_core.example").build();
glean::initialize(cfg, ClientInfoMetrics::unknown());
let prototype_ping = PingType::new("prototype", true, true, true, true, true, vec!(), vec!());
prototype_ping.submit(None);
Modules§
- Handling the Glean upload logic.
- The different metric types supported by the Glean SDK to handle data.
- API definitions for the different metric types supported by the Glean SDK.
Structs§
- Metrics included in every ping as
client_info
. - The common set of data shared across all different metric types.
- The Glean configuration.
- Configuration builder.
- Representation of a date, time and timezone.
- A snapshot of all buckets and the accumulated sum of a distribution.
- A specialized
Error
type for this crate’s operations. - The object holding meta information about a Glean instance.
- How to specify the rate at which pings may be uploaded before they are throttled.
- A rate value as given by its numerator and denominator.
- Represents the recorded data for a single event.
- Deserialized experiment data.
- Identifier for a running timer.
Enums§
- The possible error types for metric recording.
- Different kinds of histograms.
- The metric data needed to construct inner submetrics.
- The supported metrics’ lifetimes.
- Different resolutions supported by the memory related metric types (e.g. MemoryDistributionMetric).
- Different resolutions supported by the time related metric types (e.g. DatetimeMetric).
Functions§
- Returns a timestamp corresponding to “now” with millisecond precision.
- Set the remote configuration values for the metrics’ disabled property
- Performs the collection/cleanup operations required by becoming active.
- Performs the collection/cleanup operations required by becoming inactive.
- Creates and initializes a new Glean object.
- Asks the database to persist ping-lifetime data to disk.
- Sets a debug view tag.
- Indicate that an experiment is running. Glean will then add an experiment annotation to the environment which is sent with pings. This infomration is not persisted between runs.
- Indicate that an experiment is no longer running.
- Dynamically set the experimentation identifier, as opposed to setting it through the configuration during initialization.
- Sets the log pings debug option.
- Sets source tags.
- Sets whether upload is enabled or not.
- Shuts down Glean in an orderly fashion.
- Collects and submits a ping for eventual uploading by name.
- TEST ONLY FUNCTION. Returns the
RecordedExperiment
for the givenexperiment_id
or panics if the id isn’t found. - TEST ONLY FUNCTION. Gets stored experimentation id.
- TEST ONLY FUNCTION. Checks if an experiment is currently active.
- TEST ONLY FUNCTION. Resets the Glean state and triggers init again.
Type Aliases§
- A specialized
Result
type for this crate’s operations.