Struct openraft::metrics::RaftDataMetrics
source · pub struct RaftDataMetrics<NID>where
NID: NodeId,{
pub last_log: Option<LogId<NID>>,
pub last_applied: Option<LogId<NID>>,
pub snapshot: Option<LogId<NID>>,
pub purged: Option<LogId<NID>>,
pub millis_since_quorum_ack: Option<u64>,
pub replication: Option<BTreeMap<NID, Option<LogId<NID>>>>,
}
Expand description
Subset of RaftMetrics, only include data-related metrics
Fields§
§last_log: Option<LogId<NID>>
§last_applied: Option<LogId<NID>>
§snapshot: Option<LogId<NID>>
§purged: Option<LogId<NID>>
§millis_since_quorum_ack: Option<u64>
For a leader, it is the elapsed time in milliseconds since the most recently acknowledged timestamp by a quorum.
It is None
if this node is not leader, or the leader is not yet acknowledged by a quorum.
Being acknowledged means receiving a reply of
AppendEntries
(AppendEntriesRequest.vote.committed == true
).
Receiving a reply of RequestVote
(RequestVote.vote.committed == false
) does not count,
because a node will not maintain a lease for a vote with committed == false
.
This duration is used by the application to assess the likelihood that the leader has lost synchronization with the cluster. A longer duration without acknowledgment may suggest a higher probability of the leader being partitioned from the cluster.
replication: Option<BTreeMap<NID, Option<LogId<NID>>>>
Trait Implementations§
source§impl<NID> Clone for RaftDataMetrics<NID>
impl<NID> Clone for RaftDataMetrics<NID>
source§fn clone(&self) -> RaftDataMetrics<NID>
fn clone(&self) -> RaftDataMetrics<NID>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<NID> Debug for RaftDataMetrics<NID>
impl<NID> Debug for RaftDataMetrics<NID>
source§impl<NID> Default for RaftDataMetrics<NID>
impl<NID> Default for RaftDataMetrics<NID>
source§fn default() -> RaftDataMetrics<NID>
fn default() -> RaftDataMetrics<NID>
source§impl<'de, NID> Deserialize<'de> for RaftDataMetrics<NID>where
NID: NodeId,
impl<'de, NID> Deserialize<'de> for RaftDataMetrics<NID>where
NID: NodeId,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<NID> Display for RaftDataMetrics<NID>where
NID: NodeId,
impl<NID> Display for RaftDataMetrics<NID>where
NID: NodeId,
source§impl<NID> MessageSummary<RaftDataMetrics<NID>> for RaftDataMetrics<NID>where
NID: NodeId,
impl<NID> MessageSummary<RaftDataMetrics<NID>> for RaftDataMetrics<NID>where
NID: NodeId,
source§impl<NID> PartialEq for RaftDataMetrics<NID>
impl<NID> PartialEq for RaftDataMetrics<NID>
source§fn eq(&self, other: &RaftDataMetrics<NID>) -> bool
fn eq(&self, other: &RaftDataMetrics<NID>) -> bool
self
and other
values to be equal, and is used
by ==
.