pub struct WriterHealth {
pub stats: WriterStats,
pub unaccounted: u64,
pub shed: u64,
pub queue_depth: usize,
pub queue_capacity: usize,
pub last_ingest_at: Option<Timestamp>,
}Expand description
A reading of the writer’s accounting health, safe to serialise.
Note what lost does not tell you at runtime: the steady-state path
retries an unavailable sink forever, so an outage declares nothing lost
until the final flush gives up. A healthy-but-cut-off process reports
lost == 0 for its whole life. The one steady-state loss is a batch the
sink refuses (a permanent error, such as an accounting overflow): it is
counted in lost and dropped at once, because replaying it would earn the
same refusal forever and block every event behind it. The leading indicators are WriterHealth::ingest_age, a
queue_depth approaching queue_capacity, and stats.rejected — which the
sink has already refused, and which is bounded billing loss.
Fields§
§stats: WriterStatsThe same accounting and coverage diagnostics a clean shutdown returns, read live.
unaccounted: u64Charges in the queue with no billing outcome yet.
shed: u64Requests refused for want of queue capacity (INVARIANTS.md GL-8).
queue_depth: usizeSlots currently held by queued events and outstanding permits.
queue_capacity: usizeThe shed point: queue_depth reaching this denies the next request.
last_ingest_at: Option<Timestamp>When the sink last answered, or None if it never has.
Implementations§
Source§impl WriterHealth
impl WriterHealth
Sourcepub fn ingest_age(&self, now: Timestamp) -> Option<SignedDuration>
pub fn ingest_age(&self, now: Timestamp) -> Option<SignedDuration>
How long since the sink last answered — the signal that separates “no
traffic” from “the sink has been unreachable for twenty minutes”.
None while no ingest has ever succeeded, which is also the state of a
freshly started process.
Trait Implementations§
Source§impl Clone for WriterHealth
impl Clone for WriterHealth
impl Copy for WriterHealth
Source§impl Debug for WriterHealth
impl Debug for WriterHealth
impl Eq for WriterHealth
Source§impl PartialEq for WriterHealth
impl PartialEq for WriterHealth
impl StructuralPartialEq for WriterHealth
Auto Trait Implementations§
impl Freeze for WriterHealth
impl RefUnwindSafe for WriterHealth
impl Send for WriterHealth
impl Sync for WriterHealth
impl Unpin for WriterHealth
impl UnsafeUnpin for WriterHealth
impl UnwindSafe for WriterHealth
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
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<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.