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

pub enum Metric {
Show variants 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>), Jwe(String), Rate(i32i32),
}
Expand description

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)
Expand description

A boolean metric. See BooleanMetric for more information.

Counter(i32)
Expand description

A counter metric. See CounterMetric for more information.

CustomDistributionExponential(Histogram<PrecomputedExponential>)
Expand description

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

CustomDistributionLinear(Histogram<PrecomputedLinear>)
Expand description

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

Expand description

A datetime metric. See DatetimeMetric for more information.

Experiment(RecordedExperimentData)
Expand description

An experiment metric. See ExperimentMetric for more information.

Quantity(i64)
Expand description

A quantity metric. See QuantityMetric for more information.

String(String)
Expand description

A string metric. See StringMetric for more information.

StringList(Vec<String>)
Expand description

A string list metric. See StringListMetric for more information.

Uuid(String)
Expand description

A UUID metric. See UuidMetric for more information.

Timespan(DurationTimeUnit)
Expand description

A timespan metric. See TimespanMetric for more information.

TimingDistribution(Histogram<Functional>)
Expand description

A timing distribution. See TimingDistributionMetric for more information.

MemoryDistribution(Histogram<Functional>)
Expand description

A memory distribution. See MemoryDistributionMetric for more information.

Jwe(String)
Expand description

A JWE metric. See JweMetric for more information.

Rate(i32i32)
Expand description

A rate metric. See RateMetric for more information.

Implementations

impl Metric[src]

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

Gets 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]

fn clone(&self) -> Metric[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Metric[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<Metric> for Metric[src]

fn eq(&self, other: &Metric) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Metric) -> bool[src]

This method tests for !=.

impl Serialize for Metric[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl StructuralPartialEq 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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn to_bytes(&self) -> Result<Vec<u8, Global>, DataError>[src]

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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