Skip to main content

TaskExecutionTracker

Struct TaskExecutionTracker 

Source
pub struct TaskExecutionTracker { /* private fields */ }
Expand description

Task execution tracker: records the result of each task trigger, supports per-task history query and statistics.

Independent component, does not modify CronScheduler internal state. Caller can manually record after try_fire_due or use CronScheduler::try_fire_due_tracked convenience method.

Implementations§

Source§

impl TaskExecutionTracker

Source

pub fn new() -> Self

Source

pub fn with_capacity(max_capacity: usize) -> Self

Source

pub fn record(&self, record: TaskExecutionRecord)

Source

pub fn get_task_history(&self, task_id: &str) -> Vec<TaskExecutionRecord>

Source

pub fn get_last_status(&self, task_id: &str) -> Option<TaskStatus>

Source

pub fn get_failure_count(&self, task_id: &str) -> usize

Source

pub fn get_success_count(&self, task_id: &str) -> usize

Source

pub fn get_total_count(&self, task_id: &str) -> usize

Source

pub fn get_success_rate(&self, task_id: &str) -> f64

Source

pub fn clear(&self)

Source

pub fn clear_task(&self, task_id: &str)

Source

pub fn record_count(&self) -> usize

Source§

impl TaskExecutionTracker

Trait Implementations§

Source§

impl Default for TaskExecutionTracker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.