pub struct StateDivergenceCheck { /* private fields */ }Expand description
Health check for monitoring state convergence.
This check monitors the state reconciliation engine to ensure that state is converging properly across the network. State divergence can indicate network partitions, bugs in the reconciliation logic, or other serious issues.
§Status Determination
Healthy: State is converging normallyDegraded: State convergence is slow or stalledUnhealthy: State divergence detected
§Example
use elara_runtime::health::{StateDivergenceCheck, HealthCheck};
use elara_runtime::node::Node;
use std::sync::Arc;
let node = Arc::new(Node::new());
let check = StateDivergenceCheck::new(node);
let result = check.check();Implementations§
Source§impl StateDivergenceCheck
impl StateDivergenceCheck
Sourcepub fn with_threshold(node: Arc<Node>, max_pending_events: usize) -> Self
pub fn with_threshold(node: Arc<Node>, max_pending_events: usize) -> Self
Creates a new StateDivergenceCheck with a custom threshold.
§Arguments
node- Arc reference to the Node to monitormax_pending_events- Maximum pending events before degraded status
§Example
use elara_runtime::health::StateDivergenceCheck;
use elara_runtime::node::Node;
use std::sync::Arc;
let node = Arc::new(Node::new());
let check = StateDivergenceCheck::with_threshold(node, 500);Sourcepub fn max_pending_events(&self) -> usize
pub fn max_pending_events(&self) -> usize
Returns the configured maximum pending events threshold.
Trait Implementations§
Source§impl HealthCheck for StateDivergenceCheck
impl HealthCheck for StateDivergenceCheck
Auto Trait Implementations§
impl Freeze for StateDivergenceCheck
impl RefUnwindSafe for StateDivergenceCheck
impl Send for StateDivergenceCheck
impl Sync for StateDivergenceCheck
impl Unpin for StateDivergenceCheck
impl UnsafeUnpin for StateDivergenceCheck
impl UnwindSafe for StateDivergenceCheck
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request