pub(crate) struct ClassCounters {
name: String,
bytes_delivered: AtomicU64,
bytes_dropped: AtomicU64,
objects_delivered: AtomicU64,
objects_dropped: AtomicU64,
tokens_exhausted_episodes: AtomicU64,
blocked_episodes: AtomicU64,
starved_behind_other_class: AtomicU64,
}Expand description
One class’s atomic counters — the storage behind one ClassStats.
name is immutable for the recorder’s lifetime, so it is a plain
String rather than anything shared: the class list cannot change
under a running session.
Fields§
§name: String§bytes_delivered: AtomicU64§bytes_dropped: AtomicU64§objects_delivered: AtomicU64§objects_dropped: AtomicU64§tokens_exhausted_episodes: AtomicU64§blocked_episodes: AtomicU64§starved_behind_other_class: AtomicU64Implementations§
Source§impl ClassCounters
impl ClassCounters
Sourcefn snapshot(&self) -> ClassStats
fn snapshot(&self) -> ClassStats
Read this row.
Sourcefn reset(&self)
fn reset(&self)
Zero every counter, keeping the row’s name.
Only ProxyRecorder resets: a session’s figures are the session’s
for its whole life. Seven relaxed stores, and deliberately not one
atomic swap of the whole row — there is no such primitive, and a
reset that raced traffic would land between two fetch_adds whatever
it was written with. What that costs is a snapshot straddling a reset
that reports a row part-cleared, which is why the reset is a caller’s
verb and not something this crate does on its own.
Auto Trait Implementations§
impl !Freeze for ClassCounters
impl RefUnwindSafe for ClassCounters
impl Send for ClassCounters
impl Sync for ClassCounters
impl Unpin for ClassCounters
impl UnsafeUnpin for ClassCounters
impl UnwindSafe for ClassCounters
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