pub struct NodeLoad {
pub nodeid: String,
pub address: SocketAddr,
pub cpu_utilization: f64,
pub memory_utilization: f64,
pub active_connections: usize,
pub average_latency: f64,
pub weight: f64,
pub last_updated: Instant,
}
Expand description
Node load information
Fields§
§nodeid: String
§address: SocketAddr
§cpu_utilization: f64
§memory_utilization: f64
§active_connections: usize
§average_latency: f64
§weight: f64
§last_updated: Instant
Implementations§
Source§impl NodeLoad
impl NodeLoad
Sourcepub fn new(nodeid: String, address: SocketAddr) -> Self
pub fn new(nodeid: String, address: SocketAddr) -> Self
Create new node load info
Sourcepub fn load_score(&self) -> f64
pub fn load_score(&self) -> f64
Calculate overall load score (0.0 = no load, 1.0 = maximum load)
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if node is available for new tasks
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeLoad
impl RefUnwindSafe for NodeLoad
impl Send for NodeLoad
impl Sync for NodeLoad
impl Unpin for NodeLoad
impl UnwindSafe for NodeLoad
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