pub struct ReplicaLinkMetrics { /* private fields */ }Expand description
Process-lifetime reconnect telemetry for the local replica’s link to its
primary. Lives on the runtime beside super::logical::ReplicaApplyMetrics
and is driven from the single health-persist chokepoint in the replica
loop, so every link-state transition is observed exactly once.
Implementations§
Source§impl ReplicaLinkMetrics
impl ReplicaLinkMetrics
Sourcepub fn observe_state(&self, state: &str)
pub fn observe_state(&self, state: &str)
Observe a persisted replica health state string and advance the
reconnect counter when the link transitions from down back to up.
Only "healthy" counts as the link being up and only "connecting"
counts as the link being down; every other state (apply errors,
rebootstrap phases, rejoining, …) is neither a clean up nor a link
drop and leaves the tracked state unchanged, so it can neither arm
nor fire a reconnect.
Sourcepub fn reconnects_total(&self) -> u64
pub fn reconnects_total(&self) -> u64
Total reconnects observed since process start. Monotonic within a
process; resets to 0 on restart (see module docs).
Trait Implementations§
Source§impl Debug for ReplicaLinkMetrics
impl Debug for ReplicaLinkMetrics
Auto Trait Implementations§
impl !Freeze for ReplicaLinkMetrics
impl RefUnwindSafe for ReplicaLinkMetrics
impl Send for ReplicaLinkMetrics
impl Sync for ReplicaLinkMetrics
impl Unpin for ReplicaLinkMetrics
impl UnsafeUnpin for ReplicaLinkMetrics
impl UnwindSafe for ReplicaLinkMetrics
Blanket Implementations§
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request