pub struct NetworkHealthMonitor { /* private fields */ }Expand description
Network health monitor
Implementations§
Source§impl NetworkHealthMonitor
impl NetworkHealthMonitor
Sourcepub fn new(cluster: Arc<ClusterState>, config: HealthConfig) -> Self
pub fn new(cluster: Arc<ClusterState>, config: HealthConfig) -> Self
Create new health monitor
Sourcepub fn with_runtime_profile(
cluster: Arc<ClusterState>,
profile: &RuntimeProfile,
) -> Self
pub fn with_runtime_profile( cluster: Arc<ClusterState>, profile: &RuntimeProfile, ) -> Self
Create a monitor with thresholds derived from runtime auto-detection.
Sourcepub fn config(&self) -> HealthConfig
pub fn config(&self) -> HealthConfig
Read the current configuration lock-free.
Sourcepub fn register_tcp_probe_target(
&self,
node_id: impl Into<String>,
target: SocketAddr,
)
pub fn register_tcp_probe_target( &self, node_id: impl Into<String>, target: SocketAddr, )
Register a node-specific TCP probe target.
Sourcepub fn clear_tcp_probe_target(&self, node_id: &str) -> bool
pub fn clear_tcp_probe_target(&self, node_id: &str) -> bool
Remove a TCP probe target for a node.
Sourcepub fn get_node_health(&self, node_id: &str) -> Option<HealthCheckResult>
pub fn get_node_health(&self, node_id: &str) -> Option<HealthCheckResult>
Get health report for a specific node
Sourcepub fn get_all_health(&self) -> Vec<HealthCheckResult>
pub fn get_all_health(&self) -> Vec<HealthCheckResult>
Get health report for all nodes
Sourcepub fn healthy_node_count(&self) -> usize
pub fn healthy_node_count(&self) -> usize
Get the number of nodes whose latest health sample is healthy.
Sourcepub fn needs_quantization_fallback(&self, node_id: &str) -> bool
pub fn needs_quantization_fallback(&self, node_id: &str) -> bool
Check if node needs quantization fallback
OPTIMIZATION: Accumulates delivery ratio and latency across recent checks in a single pass without allocating intermediate candidate vectors or performing multiple iterator traversals.
Sourcepub fn get_health_summary(&self) -> String
pub fn get_health_summary(&self) -> String
Get cluster-wide health summary
OPTIMIZATION: Consolidates node health counts into a single-pass traversal over recent_checks, eliminating three redundant iterator traversals and repeated back() calls per node.
Sourcepub fn start_periodic_checks(&self)
pub fn start_periodic_checks(&self)
Start periodic health checks in background
Sourcepub fn reconfigure_from_system_profile(&self, profile: &SystemProfile)
pub fn reconfigure_from_system_profile(&self, profile: &SystemProfile)
Re-tune health thresholds from a system profile detected at runtime.
This is the main integration point with SystemProfileWatcher: when
hardware changes (GPU hot-plug, CPU scaling), call this to keep the
health monitor’s expectations aligned with reality.
Sourcepub fn subscribe_to_watcher(
self: &Arc<Self>,
watcher: &SystemProfileWatcher,
) -> JoinHandle<()> ⓘ
pub fn subscribe_to_watcher( self: &Arc<Self>, watcher: &SystemProfileWatcher, ) -> JoinHandle<()> ⓘ
Subscribe to a SystemProfileWatcher’s broadcast channel and
automatically re-tune whenever hardware changes are detected.
Returns a JoinHandle that can be cancelled by dropping it.
Trait Implementations§
Source§impl Clone for NetworkHealthMonitor
impl Clone for NetworkHealthMonitor
Auto Trait Implementations§
impl Freeze for NetworkHealthMonitor
impl RefUnwindSafe for NetworkHealthMonitor
impl Send for NetworkHealthMonitor
impl Sync for NetworkHealthMonitor
impl Unpin for NetworkHealthMonitor
impl UnsafeUnpin for NetworkHealthMonitor
impl UnwindSafe for NetworkHealthMonitor
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<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