#[repr(transparent)]pub struct MonotonicCount(pub u64);Expand description
Pure monotonic counter — only ever goes up over a thread’s lifetime, accumulated by the kernel from thread birth to the moment of the procfs read. Sum across a group; delta across snapshots scopes the value to the inter-capture interval.
Examples in crate::ctprof_compare::CTPROF_METRICS:
nr_wakeups, nr_migrations, voluntary_csw,
nonvoluntary_csw, wait_count, iowait_count,
timeslices, minflt, majflt, syscr, syscw.
nr_threads is NOT in this category — it is a structural
gauge that goes up AND down at runtime (threads spawn and
exit), so it reduces by max across a group, not sum. See
GaugeCount.
Tuple Fields§
§0: u64Trait Implementations§
Source§impl Clone for MonotonicCount
impl Clone for MonotonicCount
Source§fn clone(&self) -> MonotonicCount
fn clone(&self) -> MonotonicCount
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MonotonicCount
impl Debug for MonotonicCount
Source§impl Default for MonotonicCount
impl Default for MonotonicCount
Source§fn default() -> MonotonicCount
fn default() -> MonotonicCount
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MonotonicCount
impl<'de> Deserialize<'de> for MonotonicCount
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MonotonicCount
impl Display for MonotonicCount
Source§impl From<MonotonicCount> for u64
impl From<MonotonicCount> for u64
Source§fn from(v: MonotonicCount) -> Self
fn from(v: MonotonicCount) -> Self
Converts to this type from the input type.
Source§impl From<u64> for MonotonicCount
impl From<u64> for MonotonicCount
Source§impl Hash for MonotonicCount
impl Hash for MonotonicCount
Source§impl Ord for MonotonicCount
impl Ord for MonotonicCount
Source§fn cmp(&self, other: &MonotonicCount) -> Ordering
fn cmp(&self, other: &MonotonicCount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MonotonicCount
impl PartialEq for MonotonicCount
Source§impl PartialOrd for MonotonicCount
impl PartialOrd for MonotonicCount
Source§impl Serialize for MonotonicCount
impl Serialize for MonotonicCount
Source§impl Summable for MonotonicCount
impl Summable for MonotonicCount
Source§fn sum_across(items: impl IntoIterator<Item = Self>) -> Self
fn sum_across(items: impl IntoIterator<Item = Self>) -> Self
Sum across the iterator, saturating at
u64::MAX.
Empty input collapses to the additive identity (zero).Source§fn try_sum_across(items: impl IntoIterator<Item = Self>) -> Option<Self>
fn try_sum_across(items: impl IntoIterator<Item = Self>) -> Option<Self>
Same total as
sum_across on every
non-empty input; returns None for an empty iterator so
callers can distinguish “no contributors” from “all
contributors summed to zero.” Useful when a downstream
derived metric (e.g. a ratio) needs to suppress the
row entirely rather than render 0 / 0. Read moreimpl Copy for MonotonicCount
impl Eq for MonotonicCount
impl StructuralPartialEq for MonotonicCount
Auto Trait Implementations§
impl Freeze for MonotonicCount
impl RefUnwindSafe for MonotonicCount
impl Send for MonotonicCount
impl Sync for MonotonicCount
impl Unpin for MonotonicCount
impl UnwindSafe for MonotonicCount
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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>
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