Skip to main content

Stats

Struct Stats 

Source
#[non_exhaustive]
pub struct Stats {
Show 14 fields pub checks: u64, pub reports: u64, pub units: u64, pub overflowed: bool, pub max_check_gap: Duration, pub max_check_gap_start: Duration, pub max_report_gap: Option<ReportGap>, pub unit_pace: Option<UnitPace>, pub check_time: Duration, pub stopped_at: Option<Duration>, pub stop_reason: Option<StopReason>, pub clock_regressions: u64, pub sites: Vec<SiteStats>, pub unattributed_calls: u64,
}
Expand description

One span’s checkpoint evidence. Gaps include entry and exit, so a span with no checks still records how long it ran unchecked.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§checks: u64

Cancellation checks (saturating).

§reports: u64

Report calls (saturating).

§units: u64

Units reported (saturating).

§overflowed: bool

Whether any count saturated; rates then lose their meaning.

§max_check_gap: Duration

Longest interval without a check: entry to first check, check to check, or last check to exit.

§max_check_gap_start: Duration

Start of that interval, in the clock’s epoch.

§max_report_gap: Option<ReportGap>

Longest interval between reports, if report timing was on.

§unit_pace: Option<UnitPace>

How long each quarter of the reported units took, if report timing was on.

§check_time: Duration

Time spent inside instrumented checks, including any work they ran.

Timing a check takes a second clock read, so a span times its first 16 checks, every 16th after them, and every check that returned a stop, and scales the timed total to all its checks. A slow check that was not timed still shows in max_check_gap, which runs from one check’s start to the next.

§stopped_at: Option<Duration>

When the first check that returned a stop error finished.

§stop_reason: Option<StopReason>

That check’s reason, which keeps cancellation apart from a timeout.

§clock_regressions: u64

Times the clock went backwards within one call, or at finish. Workers sharing a span can deliver readings out of order; that is expected, counts as a zero gap, and is not a regression.

§sites: Vec<SiteStats>

Up to 64 distinct call sites.

§unattributed_calls: u64

Calls from sites beyond the first 64. The totals above still count them.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Stats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Stats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnsafeUnpin for Stats

§

impl UnwindSafe for Stats

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.