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
impl MetricKind
Sourcepub const ALL: [MetricKind; 20]
pub const ALL: [MetricKind; 20]
Every kind, in declaration order.
Sourcepub fn of(event: &Event) -> MetricKind
pub fn of(event: &Event) -> MetricKind
The metric an event feeds.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The kind’s name in the TypeScript adapter and the Go metricKinds table.
Sourcepub fn is_counter(self) -> bool
pub fn is_counter(self) -> bool
Counters increment by one per event; every other kind records
value.
Sourcepub fn label_names(self) -> &'static [&'static str]
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.
Sourcepub fn labels(event: &Event) -> Vec<(&'static str, String)>
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.
Sourcepub fn value(event: &Event) -> f64
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
impl Clone for MetricKind
Source§fn clone(&self) -> MetricKind
fn clone(&self) -> MetricKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MetricKind
Source§impl Debug for MetricKind
impl Debug for MetricKind
impl Eq for MetricKind
Source§impl Hash for MetricKind
impl Hash for MetricKind
Source§impl PartialEq for MetricKind
impl PartialEq for MetricKind
Source§fn eq(&self, other: &MetricKind) -> bool
fn eq(&self, other: &MetricKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MetricKind
Auto Trait Implementations§
impl Freeze for MetricKind
impl RefUnwindSafe for MetricKind
impl Send for MetricKind
impl Sync for MetricKind
impl Unpin for MetricKind
impl UnsafeUnpin for MetricKind
impl UnwindSafe for MetricKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.