pub struct NodeHealthCheck {
pub node_id: Uuid,
pub success: bool,
pub latency_ms: u64,
pub cpu_utilization: f64,
pub memory_utilization: f64,
pub active_tasks: u32,
pub checked_at: i64,
pub error: Option<String>,
}Expand description
Health check result from probing a single node.
Fields§
§node_id: UuidNode that was checked
success: boolWhether the check succeeded
latency_ms: u64Response latency in milliseconds
cpu_utilization: f64CPU utilization (0.0-1.0)
memory_utilization: f64Memory utilization (0.0-1.0)
active_tasks: u32Number of active tasks on the node
checked_at: i64Unix timestamp of the check
error: Option<String>Optional error message if the check failed
Implementations§
Source§impl NodeHealthCheck
impl NodeHealthCheck
Sourcepub fn success(
node_id: Uuid,
latency_ms: u64,
cpu_utilization: f64,
memory_utilization: f64,
active_tasks: u32,
checked_at: i64,
) -> Self
pub fn success( node_id: Uuid, latency_ms: u64, cpu_utilization: f64, memory_utilization: f64, active_tasks: u32, checked_at: i64, ) -> Self
Creates a successful health check result.
Sourcepub fn failure(node_id: Uuid, error: &str, checked_at: i64) -> Self
pub fn failure(node_id: Uuid, error: &str, checked_at: i64) -> Self
Creates a failed health check result.
Sourcepub fn is_overloaded(&self) -> bool
pub fn is_overloaded(&self) -> bool
Returns true if the node appears overloaded.
Trait Implementations§
Source§impl Clone for NodeHealthCheck
impl Clone for NodeHealthCheck
Source§fn clone(&self) -> NodeHealthCheck
fn clone(&self) -> NodeHealthCheck
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeHealthCheck
impl Debug for NodeHealthCheck
Source§impl<'de> Deserialize<'de> for NodeHealthCheck
impl<'de> Deserialize<'de> for NodeHealthCheck
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeHealthCheck
impl RefUnwindSafe for NodeHealthCheck
impl Send for NodeHealthCheck
impl Sync for NodeHealthCheck
impl Unpin for NodeHealthCheck
impl UnsafeUnpin for NodeHealthCheck
impl UnwindSafe for NodeHealthCheck
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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