pub struct NodeInfo {
pub id: NodeId,
pub address: SocketAddr,
pub status: NodeStatus,
pub capabilities: NodeCapabilities,
pub last_heartbeat: Instant,
pub jobs_completed: usize,
pub average_job_duration: Duration,
}Expand description
Information about a compute node
Fields§
§id: NodeIdUnique identifier for this node
address: SocketAddrNetwork address of the node
status: NodeStatusCurrent status of the node
capabilities: NodeCapabilitiesNode capabilities
last_heartbeat: InstantLast heartbeat timestamp
jobs_completed: usizeNumber of jobs completed
average_job_duration: DurationAverage job duration
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(id: NodeId, address: SocketAddr) -> Self
pub fn new(id: NodeId, address: SocketAddr) -> Self
Create a new node info with default capabilities
Sourcepub fn is_healthy(&self, timeout: Duration) -> bool
pub fn is_healthy(&self, timeout: Duration) -> bool
Check if the node is healthy (recent heartbeat)
Sourcepub fn processing_score(&self) -> f64
pub fn processing_score(&self) -> f64
Calculate the node’s processing score for load balancing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnsafeUnpin for NodeInfo
impl UnwindSafe for NodeInfo
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,
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 more