Skip to main content

SupervisorWatchdog

Struct SupervisorWatchdog 

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

Atomic watchdog state shared by reconcile, health, and watchdog threads.

Implementations§

Source§

impl SupervisorWatchdog

Source

pub fn new(config: WatchdogConfig, created_at_ms: u64) -> SupervisorResult<Self>

Creates a watchdog with validated installation policy.

Source

pub fn record_reconcile_started(&self, timestamp_ms: u64)

Records entry into one reconciliation cycle without taking a lock.

Source

pub fn record_reconcile_completed(&self, timestamp_ms: u64) -> u64

Records successful completion and returns the new sequence.

Source

pub fn evaluate( &self, timestamp_ms: u64, ) -> Option<(WatchdogState, WatchdogState)>

Evaluates progress and returns a state transition when one occurred.

Source

pub fn mark_stopping(&self)

Marks watchdog shutdown without changing reconciliation counters.

Source

pub fn mark_failed(&self)

Marks an unrecoverable watchdog failure.

Source

pub fn config(&self) -> WatchdogConfig

Returns immutable watchdog policy.

Source

pub fn state(&self) -> WatchdogState

Returns the current atomic watchdog state.

Source

pub fn last_reconcile_at_ms(&self) -> u64

Returns the most recent reconciliation start or completion time.

Source

pub fn reconcile_sequence(&self) -> u64

Returns the number of completed reconciliation cycles.

Source

pub fn last_progress_at_ms(&self) -> u64

Returns the most recent completed reconciliation time.

Source

pub fn stalled_for_ms(&self, timestamp_ms: u64) -> u64

Returns elapsed time without a completed reconciliation cycle.

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.