Crate glean_core
source ·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
Re-exports
pub use crate::metrics::BooleanMetric;
pub use crate::metrics::CounterMetric;
pub use crate::metrics::CustomDistributionMetric;
pub use crate::metrics::Datetime;
pub use crate::metrics::DatetimeMetric;
pub use crate::metrics::DenominatorMetric;
pub use crate::metrics::DistributionData;
pub use crate::metrics::EventMetric;
pub use crate::metrics::LocalCustomDistribution;
pub use crate::metrics::LocalMemoryDistribution;
pub use crate::metrics::LocalTimingDistribution;
pub use crate::metrics::MemoryDistributionMetric;
pub use crate::metrics::MemoryUnit;
pub use crate::metrics::NumeratorMetric;
pub use crate::metrics::ObjectMetric;
pub use crate::metrics::PingType;
pub use crate::metrics::QuantityMetric;
pub use crate::metrics::Rate;
pub use crate::metrics::RateMetric;
pub use crate::metrics::RecordedEvent;
pub use crate::metrics::RecordedExperiment;
pub use crate::metrics::StringListMetric;
pub use crate::metrics::StringMetric;
pub use crate::metrics::TextMetric;
pub use crate::metrics::TimeUnit;
pub use crate::metrics::TimerId;
pub use crate::metrics::TimespanMetric;
pub use crate::metrics::TimingDistributionMetric;
pub use crate::metrics::UrlMetric;
pub use crate::metrics::UuidMetric;
pub use crate::upload::PingRequest;
pub use crate::upload::PingUploadTask;
pub use crate::upload::UploadResult;
pub use crate::upload::UploadTaskAction;
Modules
- The different metric types supported by the Glean SDK to handle data.
- Ping collection, assembly & submission.
- Storage snapshotting.
- API definitions for the different metric types supported by the Glean SDK.
- Manages the pending pings queue and directory.
Structs
- Metrics included in every ping as
client_info
. - The common set of data shared across all different metric types.
- A specialized
Error
type for this crate’s operations. - The object holding meta information about a Glean instance.
- Configuration for Glean
- A labeled metric.
- How to specify the rate at which pings may be uploaded before they are throttled.
Enums
- An error returned from callbacks.
- A list enumerating the categories of errors in this crate.
- The possible error types for metric recording.
- Different kinds of histograms.
- The metric data needed to construct inner submetrics.
- The supported metrics’ lifetimes.
Traits
- Trait for metrics that can be nested inside a labeled metric.
- A callback handler that receives the base identifier of recorded events The identifier is in the format:
<category>.<name>
- A callback object used to trigger actions on the foreign-language side.
Functions
- Returns a timestamp corresponding to “now” with millisecond precision.
- Sets a remote configuration to override metrics’ default enabled/disabled state
- Initialize the logging system based on the target platform. This ensures that logging is shown when executing the Glean SDK unit tests.
- Initialize the logging system to send JSON messages to a file descriptor (Unix) or file handle (Windows).
- Gets the currently set debug view tag.
- Gets the current log pings value.
- Gets a list of currently registered ping names.
- Get the next upload task
- Performs the collection/cleanup operations required by becoming active.
- Performs the collection/cleanup operations required by becoming inactive.
- Initializes Glean.
- Creates and initializes a new Glean object for use in a subprocess.
- Asks the database to persist ping-lifetime data to disk.
- Processes the response from an attempt to upload a ping.
- EXPERIMENTAL: Register a listener object to recieve notifications of event recordings.
- Sets whether collection is enabled or not.
- Sets a debug view tag.
- TEST-ONLY Method
- 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.
- Set an experimentation identifier dynamically.
- Sets the log pings debug option.
- Sets source tags.
- TEST-ONLY Method
- DEPRECATED Sets whether upload is enabled or not.
- Shuts down Glean in an orderly fashion.
- Collect and submit a ping for eventual upload by name.
- Collect and submit a ping (by its name) for eventual upload, synchronously.
- TEST-ONLY Method
- TEST ONLY FUNCTION. Returns the
RecordedExperiment
for the givenexperiment_id
orNone
if the id isn’t found. - TEST ONLY FUNCTION. Gets stored experimentation id annotation.
- Unregister an event listener from recieving notifications.
- TEST ONLY FUNCTION Waits on all the glean.init threads’ join handles.
- Enable or disable a ping.
- Shuts down Glean in an orderly fashion.
- Gets the number of recorded errors for the given metric and error type.
Type Aliases
- A labeled boolean.
- A labeled counter.
- A labeled custom_distribution.
- A labeled memory_distribution.
- A labeled quantity
- A labeled string.
- A labeled timing_distribution.
- A specialized
Result
type for this crate’s operations.