Struct openraft::metrics::RaftMetrics
source · pub struct RaftMetrics<NID, N>where
NID: NodeId,
N: Node,{
pub running_state: Result<(), Fatal<NID>>,
pub id: NID,
pub current_term: u64,
pub last_log_index: Option<u64>,
pub last_applied: Option<LogId<NID>>,
pub snapshot: Option<LogId<NID>>,
pub state: ServerState,
pub current_leader: Option<NID>,
pub membership_config: Arc<StoredMembership<NID, N>>,
pub replication: Option<Versioned<ReplicationMetrics<NID>>>,
}
Expand description
A set of metrics describing the current state of a Raft node.
Fields§
§running_state: Result<(), Fatal<NID>>
§id: NID
The ID of the Raft node.
current_term: u64
The current term of the Raft node.
last_log_index: Option<u64>
The last log index has been appended to this Raft node’s log.
last_applied: Option<LogId<NID>>
The last log index has been applied to this Raft node’s state machine.
snapshot: Option<LogId<NID>>
The id of the last log included in snapshot. If there is no snapshot, it is (0,0).
state: ServerState
The state of the Raft node.
current_leader: Option<NID>
The current cluster leader.
membership_config: Arc<StoredMembership<NID, N>>
The current membership config of the cluster.
replication: Option<Versioned<ReplicationMetrics<NID>>>
The metrics about the leader. It is Some() only when this node is leader.
Implementations§
source§impl<NID, N> RaftMetrics<NID, N>where
NID: NodeId,
N: Node,
impl<NID, N> RaftMetrics<NID, N>where NID: NodeId, N: Node,
pub fn new_initial(id: NID) -> Self
Trait Implementations§
source§impl<NID, N> Clone for RaftMetrics<NID, N>where
NID: NodeId + Clone,
N: Node + Clone,
impl<NID, N> Clone for RaftMetrics<NID, N>where NID: NodeId + Clone, N: Node + Clone,
source§fn clone(&self) -> RaftMetrics<NID, N>
fn clone(&self) -> RaftMetrics<NID, N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<NID, N> MessageSummary<RaftMetrics<NID, N>> for RaftMetrics<NID, N>where
NID: NodeId,
N: Node,
impl<NID, N> MessageSummary<RaftMetrics<NID, N>> for RaftMetrics<NID, N>where NID: NodeId, N: Node,
source§impl<NID, N> PartialEq<RaftMetrics<NID, N>> for RaftMetrics<NID, N>where
NID: NodeId + PartialEq,
N: Node + PartialEq,
impl<NID, N> PartialEq<RaftMetrics<NID, N>> for RaftMetrics<NID, N>where NID: NodeId + PartialEq, N: Node + PartialEq,
source§fn eq(&self, other: &RaftMetrics<NID, N>) -> bool
fn eq(&self, other: &RaftMetrics<NID, N>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<NID, N> Eq for RaftMetrics<NID, N>where NID: NodeId + Eq, N: Node + Eq,
impl<NID, N> StructuralEq for RaftMetrics<NID, N>where NID: NodeId, N: Node,
impl<NID, N> StructuralPartialEq for RaftMetrics<NID, N>where NID: NodeId, N: Node,
Auto Trait Implementations§
impl<NID, N> RefUnwindSafe for RaftMetrics<NID, N>where N: RefUnwindSafe, NID: RefUnwindSafe,
impl<NID, N> Send for RaftMetrics<NID, N>
impl<NID, N> Sync for RaftMetrics<NID, N>
impl<NID, N> Unpin for RaftMetrics<NID, N>where NID: Unpin,
impl<NID, N> UnwindSafe for RaftMetrics<NID, N>where N: RefUnwindSafe, NID: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.