[][src]Enum glean_core::metrics::Metric

pub enum Metric {
    Boolean(bool),
    Counter(i32),
    CustomDistributionExponential(Histogram<PrecomputedExponential>),
    CustomDistributionLinear(Histogram<PrecomputedLinear>),
    Datetime(DateTime<FixedOffset>, TimeUnit),
    Experiment(RecordedExperimentData),
    Quantity(i64),
    String(String),
    StringList(Vec<String>),
    Uuid(String),
    Timespan(DurationTimeUnit),
    TimingDistribution(Histogram<Functional>),
    MemoryDistribution(Histogram<Functional>),
}

The available metrics.

This is the in-memory and persisted layout of a metric.

Note

The order of metrics in this enum is important, as it is used for serialization. Do not reorder the variants.

Any new metric must be added at the end.

Variants

Boolean(bool)

A boolean metric. See BooleanMetric for more information.

Counter(i32)

A counter metric. See CounterMetric for more information.

CustomDistributionExponential(Histogram<PrecomputedExponential>)

A custom distribution with precomputed exponential bucketing. See CustomDistributionMetric for more information.

CustomDistributionLinear(Histogram<PrecomputedLinear>)

A custom distribution with precomputed linear bucketing. See CustomDistributionMetric for more information.

A datetime metric. See DatetimeMetric for more information.

Experiment(RecordedExperimentData)

An experiment metric. See ExperimentMetric for more information.

Quantity(i64)

A quantity metric. See QuantityMetric for more information.

String(String)

A string metric. See StringMetric for more information.

StringList(Vec<String>)

A string list metric. See StringListMetric for more information.

Uuid(String)

A UUID metric. See UuidMetric for more information.

Timespan(DurationTimeUnit)

A timespan metric. See TimespanMetric for more information.

TimingDistribution(Histogram<Functional>)

A timing distribution. See TimingDistributionMetric for more information.

MemoryDistribution(Histogram<Functional>)

A memory distribution. See MemoryDistributionMetric for more information.

Methods

impl Metric[src]

pub fn ping_section(&self) -> &'static str[src]

The ping section the metric fits into.

This determines the section of the ping to place the metric data in when assembling the ping payload.

pub fn as_json(&self) -> JsonValue[src]

The JSON representation of the metric's data

Trait Implementations

impl Clone for Metric[src]

impl Debug for Metric[src]

impl<'de> Deserialize<'de> for Metric[src]

impl Serialize for Metric[src]

Auto Trait Implementations

impl RefUnwindSafe for Metric

impl Send for Metric

impl !Sync for Metric

impl Unpin for Metric

impl UnwindSafe for Metric

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> EncodableKey for T where
    T: Serialize
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,