pub struct WorkerLoad {
pub worker_id: u64,
pub connections: u32,
pub cpu_pct: f64,
pub memory_pct: f64,
pub weight: u32,
}Expand description
Snapshot of a worker’s current load.
Fields§
§worker_id: u64§connections: u32§cpu_pct: f64§memory_pct: f64§weight: u32Implementations§
Source§impl WorkerLoad
impl WorkerLoad
Sourcepub fn load_score(&self) -> f64
pub fn load_score(&self) -> f64
Composite load score in [0, 1]. Higher means more loaded.
Sourcepub fn is_overloaded(&self) -> bool
pub fn is_overloaded(&self) -> bool
Returns true when the load score exceeds 0.9 (90 %).
Trait Implementations§
Source§impl Clone for WorkerLoad
impl Clone for WorkerLoad
Source§fn clone(&self) -> WorkerLoad
fn clone(&self) -> WorkerLoad
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 moreAuto Trait Implementations§
impl Freeze for WorkerLoad
impl RefUnwindSafe for WorkerLoad
impl Send for WorkerLoad
impl Sync for WorkerLoad
impl Unpin for WorkerLoad
impl UnsafeUnpin for WorkerLoad
impl UnwindSafe for WorkerLoad
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> 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