pub struct JobTracker { /* private fields */ }Expand description
Stores and queries distributed jobs.
Implementations§
Source§impl JobTracker
impl JobTracker
Sourcepub fn submit(&mut self, job: DistributedJob)
pub fn submit(&mut self, job: DistributedJob)
Add a job to the tracker.
Sourcepub fn get(&self, id: u64) -> Option<&DistributedJob>
pub fn get(&self, id: u64) -> Option<&DistributedJob>
Look up a job by ID (immutable).
Sourcepub fn get_mut(&mut self, id: u64) -> Option<&mut DistributedJob>
pub fn get_mut(&mut self, id: u64) -> Option<&mut DistributedJob>
Look up a job by ID (mutable).
Sourcepub fn queued_jobs(&self) -> Vec<&DistributedJob>
pub fn queued_jobs(&self) -> Vec<&DistributedJob>
Return all jobs currently in the Queued state.
Sourcepub fn running_jobs(&self) -> Vec<&DistributedJob>
pub fn running_jobs(&self) -> Vec<&DistributedJob>
Return all jobs currently in the Running state.
Sourcepub fn failed_jobs(&self) -> Vec<&DistributedJob>
pub fn failed_jobs(&self) -> Vec<&DistributedJob>
Return all jobs currently in the Failed state.
Sourcepub fn completion_rate(&self) -> f64
pub fn completion_rate(&self) -> f64
Fraction of jobs that completed successfully.
Returns 0.0 when no jobs have been submitted.
Sourcepub fn total_jobs(&self) -> usize
pub fn total_jobs(&self) -> usize
Return the total number of tracked jobs.
Trait Implementations§
Source§impl Debug for JobTracker
impl Debug for JobTracker
Source§impl Default for JobTracker
impl Default for JobTracker
Source§fn default() -> JobTracker
fn default() -> JobTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JobTracker
impl RefUnwindSafe for JobTracker
impl Send for JobTracker
impl Sync for JobTracker
impl Unpin for JobTracker
impl UnsafeUnpin for JobTracker
impl UnwindSafe for JobTracker
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> 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