Skip to main content

BenchmarkPass

Struct BenchmarkPass 

pub struct BenchmarkPass { /* private fields */ }
Available on crate feature bench only.
Expand description

One measured pass within a scenario.

A scenario reports one pass per thing it did that a decision could be made about — the seeding append, the contended append, each of the two replays — so a reader can tell “the workload ran and this is what it cost” from “the workload never happened”.

The counters are deliberately counts and not durations. Nothing under crates/happenstance-testkit/src may read a clock (CF-33), so the elapsed time of a pass is the caller’s emitter’s to produce and to report beside this record.

Implementations§

§

impl BenchmarkPass

pub const fn label(&self) -> &'static str

What this pass measured — "append", "seed", "contend", "replay-all" or "replay-tagged".

pub const fn attempts(&self) -> usize

How many operations this pass attempted.

pub const fn committed(&self) -> usize

How many of them did the work they were asked to do.

pub const fn rejected(&self) -> usize

How many lost a race, as ConditionViolated.

The number ADR-0012 asked this instrument for: a contended run whose rejection count is zero measured no contention, whatever its timing said.

pub const fn refused(&self) -> usize

How many met a stated store limit.

Limits are declared facts about a fixture rather than trades, so a benchmark meeting one is a legitimate outcome that has to be legible in the output — never counted as completed work, and never a panic.

pub const fn failed(&self) -> usize

How many failed for a transport or store reason.

Kept apart from rejected for the reason concurrency::Attempt keeps them apart: collapsing the two would let a broken store report a perfect rejection mix.

pub const fn events(&self) -> usize

How many events this pass wrote or read.

pub const fn is_well_formed(&self) -> bool

Whether every attempt is accounted for by exactly one counter.

Trait Implementations§

§

impl Clone for BenchmarkPass

§

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
§

impl Debug for BenchmarkPass

§

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

Formats the value using the given formatter. Read more
§

impl Eq for BenchmarkPass

§

impl PartialEq for BenchmarkPass

§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for BenchmarkPass

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V