pub struct TickHistory { /* private fields */ }Expand description
Ring-buffer of recent tick results for analysis.
Implementations§
Source§impl TickHistory
impl TickHistory
Sourcepub fn record(&mut self, result: CognitiveTickResult)
pub fn record(&mut self, result: CognitiveTickResult)
Record a tick result, evicting the oldest if at capacity.
Sourcepub fn changes_per_minute(&self) -> f64
pub fn changes_per_minute(&self) -> f64
Compute the average changes per minute based on recorded ticks.
Uses total elapsed time and total change events to derive rate.
Sourcepub fn avg_budget_usage(&self) -> f64
pub fn avg_budget_usage(&self) -> f64
Compute average budget usage ratio (elapsed / budget).
Sourcepub fn idle_ticks(&self) -> usize
pub fn idle_ticks(&self) -> usize
Count consecutive idle ticks (no changes) at the tail.
Sourcepub fn all(&self) -> &VecDeque<CognitiveTickResult>
pub fn all(&self) -> &VecDeque<CognitiveTickResult>
All recorded tick results.
Auto Trait Implementations§
impl Freeze for TickHistory
impl RefUnwindSafe for TickHistory
impl Send for TickHistory
impl Sync for TickHistory
impl Unpin for TickHistory
impl UnsafeUnpin for TickHistory
impl UnwindSafe for TickHistory
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more