pub struct BackendMetricsSnapshot {
pub backend_generation: u64,
pub generation: u64,
pub devices: [Option<BackendDeviceMetricsSnapshot>; 64],
pub attempts: BackendAttemptMetricsSnapshot,
}Expand description
Coherent fixed-cardinality snapshot of one backend metrics generation.
generation advances after each accepted store update. Consumers that
combine this snapshot with another read can compare the two generations;
unequal backend or store generations make a torn combination detectable.
All device slots are fixed. None means that ordinal is not part of this
backend generation.
Fields§
§backend_generation: u64Backend resource generation that owns these metrics.
generation: u64Store update sequence advanced after each accepted metric update.
devices: [Option<BackendDeviceMetricsSnapshot>; 64]Fixed ordinal-indexed device slots; None for an unconfigured ordinal.
attempts: BackendAttemptMetricsSnapshotTerminal counters and duration histograms accumulated at report readiness.
Implementations§
Source§impl BackendMetricsSnapshot
impl BackendMetricsSnapshot
Sourcepub const fn device(
&self,
device_ordinal: usize,
) -> Option<BackendDeviceMetricsSnapshot>
pub const fn device( &self, device_ordinal: usize, ) -> Option<BackendDeviceMetricsSnapshot>
Returns the configured device record for one bounded device ordinal.
Sourcepub fn project_backend_metric(
&self,
descriptor: &'static BackendMetricDescriptor,
) -> Result<Vec<BackendMetricSample>, BackendMetricProjectionError>
pub fn project_backend_metric( &self, descriptor: &'static BackendMetricDescriptor, ) -> Result<Vec<BackendMetricSample>, BackendMetricProjectionError>
Projects one canonical descriptor from this coherent snapshot.
This is the only control-plane boundary that derives backend metric
samples, labels, duration units, or histogram bucket semantics. An
exporter therefore only iterates the immutable descriptor registry and
selects its ingress by crate::metrics::BackendMetricKind.
Trait Implementations§
Source§impl Clone for BackendMetricsSnapshot
impl Clone for BackendMetricsSnapshot
Source§impl Debug for BackendMetricsSnapshot
impl Debug for BackendMetricsSnapshot
impl Eq for BackendMetricsSnapshot
Source§impl PartialEq for BackendMetricsSnapshot
impl PartialEq for BackendMetricsSnapshot
Source§impl Serialize for BackendMetricsSnapshot
impl Serialize for BackendMetricsSnapshot
impl StructuralPartialEq for BackendMetricsSnapshot
Auto Trait Implementations§
impl Freeze for BackendMetricsSnapshot
impl RefUnwindSafe for BackendMetricsSnapshot
impl Send for BackendMetricsSnapshot
impl Sync for BackendMetricsSnapshot
impl Unpin for BackendMetricsSnapshot
impl UnsafeUnpin for BackendMetricsSnapshot
impl UnwindSafe for BackendMetricsSnapshot
Blanket Implementations§
impl<T> Allocation for T
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more