pub struct KeyStats {
pub count: u64,
pub bytes: u64,
pub rate_hz: f64,
pub last_seen: Instant,
pub sn_gaps: u64,
pub sn_resets: u64,
pub unstamped: u64,
/* private fields */
}Expand description
One key’s running statistics.
Fields§
§count: u64§bytes: u64§rate_hz: f64EWMA of the instantaneous rate (Hz), time-decayed.
last_seen: Instant§sn_gaps: u64Consecutive source-sequence-number gap count, when publishers attach
SourceInfo (unstable API) — loss visibility, --loss. Wrap-safe:
the SN is a u32, so u32::MAX → 0 is the next sample, not a
4-billion-sample gap (see the private SN_RESET_WINDOW).
sn_resets: u64Times the sequence numbering restarted — a backwards or absurd jump
(beyond the private SN_RESET_WINDOW), which is a publisher restart, not
loss. Its own number: folding a restart into sn_gaps would invent
millions of “lost” samples nobody sent (RFC 09 §5.1 O6 — the kinds
are never folded).
unstamped: u64Samples that carried no HLC timestamp — an observation of their own, counted separately: an unstamped sample has no latency, which is not the same as zero latency (#119).
Implementations§
Source§impl KeyStats
impl KeyStats
Sourcepub fn latency(&self) -> Option<LatencyReport>
pub fn latency(&self) -> Option<LatencyReport>
The window’s distributions, split by who stamped them (#213).
None before any stamped sample — which is not zero latency, and is
why KeyStats::unstamped is counted beside this rather than folded
into it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyStats
impl RefUnwindSafe for KeyStats
impl Send for KeyStats
impl Sync for KeyStats
impl Unpin for KeyStats
impl UnsafeUnpin for KeyStats
impl UnwindSafe for KeyStats
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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