pub struct ThrottleMonitor { /* private fields */ }Expand description
2026-09-26: Rolling detector over successive counter reads.
Holds the previous read; each observe returns the window
between the two. The first call after construction returns None: one read
cannot be differenced, and a zero would read as “no throttling” rather than
“not known yet”.
Implementations§
Source§impl ThrottleMonitor
impl ThrottleMonitor
pub fn new() -> Self
Sourcepub fn observe(
&mut self,
now_ms: u64,
counters: ThrottleCounters,
) -> Option<ThrottleWindow>
pub fn observe( &mut self, now_ms: u64, counters: ThrottleCounters, ) -> Option<ThrottleWindow>
2026-09-26: Difference counters (read at now_ms) against the previous read.
Returns None on the first read and when now_ms is not after the previous
read; in the second case the previous read is kept. A counter that went
backwards (a driver reload or GPU reset) still yields a window, with the
fraction it feeds None rather than a negative or saturated number.
Sourcepub fn transitions(&self) -> usize
pub fn transitions(&self) -> usize
2026-09-26: Times thermal_active flipped across the retained history.
Separate from the fraction: a part pinned at full throttle has a high fraction and zero transitions, unlike one that flaps every window.
Sourcepub fn samples(&self) -> usize
pub fn samples(&self) -> usize
2026-09-26: Windows retained for transitions, so a
caller can tell “0 transitions over 30 windows” from “0 over 1”.
Trait Implementations§
Source§impl Clone for ThrottleMonitor
impl Clone for ThrottleMonitor
Source§fn clone(&self) -> ThrottleMonitor
fn clone(&self) -> ThrottleMonitor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ThrottleMonitor
impl Debug for ThrottleMonitor
Source§impl Default for ThrottleMonitor
impl Default for ThrottleMonitor
Source§fn default() -> ThrottleMonitor
fn default() -> ThrottleMonitor
Auto Trait Implementations§
impl Freeze for ThrottleMonitor
impl RefUnwindSafe for ThrottleMonitor
impl Send for ThrottleMonitor
impl Sync for ThrottleMonitor
impl Unpin for ThrottleMonitor
impl UnwindSafe for ThrottleMonitor
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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