Skip to main content

MetricKind

Enum MetricKind 

Source
pub enum MetricKind {
Show 20 variants Request, Miss, Disabled, Error, Invalidation, Coalesced, ShadowValidation, ShadowValueAge, ShadowMismatchLogging, FutureTimestampOffset, StaleRecovery, StaleRecoveryValueAge, Compression, Get, Fallback, Serialization, Size, StoredSize, CompressionRatio, CompressionDuration,
}
Expand description

The metric an Event feeds. Variant names match the TypeScript adapter method names and the Go metricKinds table.

Variants§

§

Request

Counter of lookups that reached an enabled layer (Event::Request).

§

Miss

Counter of classified misses (Event::Miss).

§

Disabled

Counter of skipped layers and no-layer calls (Event::Disabled).

§

Error

Counter of bounded failure sites (Event::Error).

§

Invalidation

Counter of explicit invalidation attempts (Event::Invalidation).

§

Coalesced

Counter of callers that joined an in-flight execution (Event::Coalesced).

§

ShadowValidation

Counter of terminal shadow job outcomes (Event::ShadowValidation).

§

ShadowValueAge

Seconds: validated value age at a match or mismatch verdict (Event::ShadowValueAge).

§

ShadowMismatchLogging

Counter of confirmed-mismatch warning attempts (Event::ShadowMismatchLogging).

§

FutureTimestampOffset

Seconds: how far a frame is dated ahead of the observing clock (Event::FutureTimestampOffset).

§

StaleRecovery

Counter of authorized stale-recovery checks (Event::StaleRecovery).

§

StaleRecoveryValueAge

Seconds: age of a stale value when recovery served it (Event::StaleRecoveryValueAge).

§

Compression

Counter of envelope outcomes on writes and reads (Event::Compression).

§

Get

Seconds: layer lookup latency (Event::Get).

§

Fallback

Seconds: time until the source settled or timed out (Event::Fallback).

§

Serialization

Seconds: codec encode or decode latency (Event::Serialization).

§

Size

Bytes: serializer output before compression and escaping (Event::Size).

§

StoredSize

Bytes: prepared payload after compression and escaping (Event::StoredSize).

§

CompressionRatio

Ratio: stored over original bytes of a compressed write (Event::CompressionRatio).

§

CompressionDuration

Seconds: zstd compress or decompress latency (Event::CompressionDuration).

Implementations§

Source§

impl MetricKind

Source

pub const ALL: [MetricKind; 20]

Every kind, in declaration order.

Source

pub fn of(event: &Event) -> MetricKind

The metric an event feeds.

Source

pub fn as_str(self) -> &'static str

The kind’s name in the TypeScript adapter and the Go metricKinds table.

Source

pub fn is_counter(self) -> bool

Counters increment by one per event; every other kind records value.

Source

pub fn index(self) -> usize

Position of the kind in ALL.

Source

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

The label names of this kind, in wire order: the Prometheus label schema and the Datadog tag set of the TypeScript adapters.

Source

pub fn labels(event: &Event) -> Vec<(&'static str, String)>

The labels of an event, in the order of label_names for of(event). Values are bounded enumerations plus the namespace, use case and key type; the logical key is never one.

Source

pub fn value(event: &Event) -> f64

The value an event records: seconds for timers, ages and offsets, bytes for sizes, the compressed-to-original ratio for CompressionRatio, and the increment 1 for counters.

Trait Implementations§

Source§

impl Clone for MetricKind

Source§

fn clone(&self) -> MetricKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MetricKind

Source§

impl Debug for MetricKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MetricKind

Source§

impl Hash for MetricKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MetricKind

Source§

fn eq(&self, other: &MetricKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MetricKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.