pub struct WorkerInfo {
pub worker_id: String,
pub address: String,
pub status: WorkerStatus,
pub last_heartbeat: Instant,
pub active_tasks: usize,
pub completed_tasks: u64,
pub failed_tasks: u64,
}Expand description
Information about a connected worker.
Fields§
§worker_id: StringWorker identifier.
address: StringWorker address.
status: WorkerStatusCurrent status.
last_heartbeat: InstantLast heartbeat timestamp.
active_tasks: usizeNumber of active tasks.
completed_tasks: u64Total tasks completed.
failed_tasks: u64Total tasks failed.
Implementations§
Source§impl WorkerInfo
impl WorkerInfo
Sourcepub fn update_heartbeat(&mut self)
pub fn update_heartbeat(&mut self)
Update heartbeat timestamp.
Sourcepub fn is_timed_out(&self, timeout: Duration) -> bool
pub fn is_timed_out(&self, timeout: Duration) -> bool
Check if the worker has timed out.
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get the success rate.
Trait Implementations§
Source§impl Clone for WorkerInfo
impl Clone for WorkerInfo
Source§fn clone(&self) -> WorkerInfo
fn clone(&self) -> WorkerInfo
Returns a duplicate of the value. Read more
1.0.0 · 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 WorkerInfo
impl RefUnwindSafe for WorkerInfo
impl Send for WorkerInfo
impl Sync for WorkerInfo
impl Unpin for WorkerInfo
impl UnsafeUnpin for WorkerInfo
impl UnwindSafe for WorkerInfo
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