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>
impl<M, I, N, C> Trace<M, I, N, C>
pub fn events(&self) -> &[TraceEvent<M, I, N, C>]
Sourcepub fn invocations(&self) -> impl Iterator<Item = (NodeId, OpId, &C)>
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.
Sourcepub fn invoked_at(&self, op: OpId) -> Option<Time>
pub fn invoked_at(&self, op: OpId) -> Option<Time>
When op was handled, if it was.
Sourcepub fn not_begun(&self) -> impl Iterator<Item = (NodeId, OpId, NotBegun)>
pub fn not_begun(&self) -> impl Iterator<Item = (NodeId, OpId, NotBegun)>
Every operation that never reached the process it was given to, and why.
Sourcepub fn why_not_begun(&self, op: OpId) -> Option<NotBegun>
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.
Sourcepub fn notes(&self) -> impl Iterator<Item = (NodeId, &N)>
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.
Sourcepub fn notes_at(&self, node: NodeId) -> impl Iterator<Item = &N>
pub fn notes_at(&self, node: NodeId) -> impl Iterator<Item = &N>
Every decision narrated by node, in order.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn indications(&self) -> impl Iterator<Item = (NodeId, &I)>
pub fn indications(&self) -> impl Iterator<Item = (NodeId, &I)>
Every indication raised, in order, with the process that raised it.
Sourcepub fn indications_at(&self, node: NodeId) -> impl Iterator<Item = &I>
pub fn indications_at(&self, node: NodeId) -> impl Iterator<Item = &I>
Every indication raised by node, in order.
Sourcepub fn deliveries(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>
pub fn deliveries(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>
Every message actually handed to a recipient.
Sourcepub fn sends(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>
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.
Sourcepub fn handed_to_self(&self) -> impl Iterator<Item = (NodeId, &M)>
pub fn handed_to_self(&self) -> impl Iterator<Item = (NodeId, &M)>
Every message a process handed to itself, without the network.
Sourcepub fn exchanges(&self) -> impl Iterator<Item = (NodeId, NodeId, &M)>
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.
Sourcepub fn drops_because(&self, reason: DropReason) -> usize
pub fn drops_because(&self, reason: DropReason) -> usize
How many messages were dropped for a specific reason.
pub fn duplicates(&self) -> usize
pub fn reorderings(&self) -> usize
Sourcepub fn session_ends(&self) -> usize
pub fn session_ends(&self) -> usize
How many sessions ended during the run.
Sourcepub fn suffix_losses(&self) -> usize
pub fn suffix_losses(&self) -> usize
How many messages were discarded because a session carrying them ended.
Sourcepub fn session_epochs(&self) -> impl Iterator<Item = (NodeId, NodeId, u64)> + '_
pub fn session_epochs(&self) -> impl Iterator<Item = (NodeId, NodeId, u64)> + '_
The epochs at which sessions were established, in order.
Sourcepub fn metadata_writes(&self) -> usize
pub fn metadata_writes(&self) -> usize
How many times the metadata was replaced.
Sourcepub fn deaths_in_writes(&self) -> usize
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.
Sourcepub fn recoveries_with_state(&self) -> usize
pub fn recoveries_with_state(&self) -> usize
How many restarts recovered durable state, as opposed to starting afresh.
pub fn timer_fires(&self) -> usize
pub fn delivery_count(&self) -> usize
Sourcepub fn send_count(&self) -> usize
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.
Sourcepub fn exchange_count(&self) -> usize
pub fn exchange_count(&self) -> usize
How many messages a protocol asked to transmit, wherever they went — the counterpart of
ProtoTrace::exchanges.