pub struct NodeStats {
pub role: Role,
pub current_term: Term,
pub leader: Option<NodeId>,
pub commit_index: LogIndex,
pub last_applied: LogIndex,
pub last_log_index: LogIndex,
pub snapshot_index: LogIndex,
pub peers: BTreeMap<NodeId, PeerStats>,
}Expand description
A node’s whole operating state at one instant, as data.
Returned by Node::stats. Every field is the value the node’s
own accessor of the same meaning reports at the same instant,
so a snapshot taken around a step explains the step.
Fields§
§role: RoleThe role the node currently plays.
current_term: TermThe node’s current term.
leader: Option<NodeId>The leader this node currently acknowledges, if any.
commit_index: LogIndexThe highest index known to be committed.
last_applied: LogIndexThe highest index applied to the state machine.
last_log_index: LogIndexThe last index in the log.
snapshot_index: LogIndexThe log base: the index the latest snapshot covers.
peers: BTreeMap<NodeId, PeerStats>Per-peer replication progress on a leader; empty otherwise.
Trait Implementations§
impl Eq for NodeStats
impl StructuralPartialEq for NodeStats
Auto Trait Implementations§
impl Forget for NodeStats
impl Freeze for NodeStats
impl Move for NodeStats
impl RefUnwindSafe for NodeStats
impl Send for NodeStats
impl Sync for NodeStats
impl Unpin for NodeStats
impl UnsafeUnpin for NodeStats
impl UnwindSafe for NodeStats
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