Skip to main content

Trace

Struct Trace 

Source
pub struct Trace<M, I, N, C> { /* private fields */ }
Expand description

An ordered log of everything a run did.

Implementations§

Source§

impl<M, I, N, C> Trace<M, I, N, C>

Source

pub fn events(&self) -> &[TraceEvent<M, I, N, C>]

Source

pub fn invocations(&self) -> impl Iterator<Item = (NodeId, OpId, &C)>

Every operation that was handled, in order: which process, its identity, and the command.

The left-hand ends of the intervals a checker needs. Pairing them with the indications that completed them is not something the trace does — see the simulation capability.

Source

pub fn invoked_at(&self, op: OpId) -> Option<Time>

When op was handled, if it was.

Source

pub fn not_begun(&self) -> impl Iterator<Item = (NodeId, OpId, NotBegun)>

Every operation that never reached the process it was given to, and why.

Source

pub fn why_not_begun(&self, op: OpId) -> Option<NotBegun>

Why op never began, if it did not. None covers both “it began” and “no such operation”, which Trace::invocations distinguishes.

Source

pub fn notes(&self) -> impl Iterator<Item = (NodeId, &N)>

Every decision narrated, in order, with the process that narrated it.

Empty unless the run was asked to record them — see Sim::record_notes.

Source

pub fn notes_at(&self, node: NodeId) -> impl Iterator<Item = &N>

Every decision narrated by node, in order.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn indications(&self) -> impl Iterator<Item = (NodeId, &I)>

Every indication raised, in order, with the process that raised it.

Source

pub fn indications_at(&self, node: NodeId) -> impl Iterator<Item = &I>

Every indication raised by node, in order.

Source

pub fn deliveries(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>

Every message actually handed to a recipient.

Source

pub fn sends(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>

Every message a protocol asked to transmit over the network.

A message a process addressed to itself is not among these: it crosses no wire, so it is not something the run put on the network, and a cost counted from here is a cost a deployment would pay. ProtoTrace::exchanges is the one to ask when what matters is that the message happened rather than where it went.

Source

pub fn handed_to_self(&self) -> impl Iterator<Item = (NodeId, &M)>

Every message a process handed to itself, without the network.

Source

pub fn exchanges(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>

Every message a protocol asked to transmit, wherever it went — the network’s and the hand-offs together, in the order they happened.

This is what to ask when the question is whether an exchange happened: whether a ballot was refused, whether a majority answered, whether two processes talked at all. A protocol whose roles are co-located answers itself as readily as it answers a peer, and a reader that saw only ProtoTrace::sends would conclude the exchange never took place. That is not hypothetical: it emptied a non-vacuity floor two registered safety tests depend on.

Source

pub fn drops(&self) -> usize

How many messages were dropped, for any reason.

Source

pub fn drops_because(&self, reason: DropReason) -> usize

How many messages were dropped for a specific reason.

Source

pub fn duplicates(&self) -> usize

Source

pub fn reorderings(&self) -> usize

Source

pub fn session_ends(&self) -> usize

How many sessions ended during the run.

Source

pub fn suffix_losses(&self) -> usize

How many messages were discarded because a session carrying them ended.

Source

pub fn session_epochs(&self) -> impl Iterator<Item = (NodeId, NodeId, u64)> + '_

The epochs at which sessions were established, in order.

Source

pub fn appends(&self) -> usize

How many entries were appended.

Source

pub fn metadata_writes(&self) -> usize

How many times the metadata was replaced.

Source

pub fn writes(&self) -> usize

How many writes happened, of either kind.

Source

pub fn deaths_in_writes(&self) -> usize

How many times a process died inside a write.

Not how many writes were lost: the seed decides that, and the trace does not say, which is the whole content of the fault.

Source

pub fn recoveries_with_state(&self) -> usize

How many restarts recovered durable state, as opposed to starting afresh.

Source

pub fn timer_fires(&self) -> usize

Source

pub fn delivery_count(&self) -> usize

Source

pub fn send_count(&self) -> usize

How many messages the run put on the network. A hand-off to oneself is not among them; see ProtoTrace::sends.

Source

pub fn exchange_count(&self) -> usize

How many messages a protocol asked to transmit, wherever they went — the counterpart of ProtoTrace::exchanges.

Source

pub fn indication_count(&self) -> usize

Trait Implementations§

Source§

impl<M: Clone, I: Clone, N: Clone, C: Clone> Clone for Trace<M, I, N, C>

Source§

fn clone(&self) -> Trace<M, I, N, C>

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<M: Debug, I: Debug, N: Debug, C: Debug> Debug for Trace<M, I, N, C>

Source§

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

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

impl<M, I, N, C> Default for Trace<M, I, N, C>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<M, I, N, C> Freeze for Trace<M, I, N, C>

§

impl<M, I, N, C> RefUnwindSafe for Trace<M, I, N, C>

§

impl<M, I, N, C> Send for Trace<M, I, N, C>
where M: Send, I: Send, C: Send, N: Send,

§

impl<M, I, N, C> Sync for Trace<M, I, N, C>
where M: Sync, I: Sync, C: Sync, N: Sync,

§

impl<M, I, N, C> Unpin for Trace<M, I, N, C>
where M: Unpin, I: Unpin, C: Unpin, N: Unpin,

§

impl<M, I, N, C> UnsafeUnpin for Trace<M, I, N, C>

§

impl<M, I, N, C> UnwindSafe for Trace<M, I, N, C>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more