You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RaftMetrics encapsulates a range of information about the internal states of
a Raft node, including the server state (e.g., Leader, Follower), and
data-related states such as the last log index and the last applied log index.
Applications interested in monitoring these details can subscribe to RaftMetrics to receive updates when these metrics change, with Raft::metrics().
However, some metrics, like last_log_index, are frequently updated, while
others, such as current_term and state, change less often.
For applications solely concerned with server state transitions (like switching
from Leader to Follower), being notified of changes to last_log_index can
result in unnecessary wake-ups.
To optimize this, it would be beneficial to add two subsets of the metrics:
Metrics that are not data-related, such as current_term, vote, and state.
Metrics that are data-related, including last_log_index and last_applied.
By segregating these metrics, applications can subscribe to the relevant subset
and reduce the overhead of processing frequent updates that are not pertinent to
their needs.
TODO:
add Raft::data_metrics() to return a watch::Receiver<RaftDataMetrics>
that contains only metrics about log, state machine and snapshot.
add Raft::server_metrics() to return a watch::Receiver<RaftServerMetrics> that contains only server related
metrics, such as vote, leader, id, running_state, membership
The text was updated successfully, but these errors were encountered:
RaftMetrics encapsulates a range of information about the internal states of
a Raft node, including the server state (e.g., Leader, Follower), and
data-related states such as the last log index and the last applied log index.
Applications interested in monitoring these details can subscribe to
RaftMetrics to receive updates when these metrics change, with
Raft::metrics()
.However, some metrics, like
last_log_index
, are frequently updated, whileothers, such as
current_term
andstate
, change less often.For applications solely concerned with server state transitions (like switching
from Leader to Follower), being notified of changes to
last_log_index
canresult in unnecessary wake-ups.
To optimize this, it would be beneficial to add two subsets of the metrics:
current_term
,vote
, andstate
.last_log_index
andlast_applied
.By segregating these metrics, applications can subscribe to the relevant subset
and reduce the overhead of processing frequent updates that are not pertinent to
their needs.
TODO:
add
Raft::data_metrics()
to return awatch::Receiver<RaftDataMetrics>
that contains only metrics about log, state machine and snapshot.
add
Raft::server_metrics()
to return awatch::Receiver<RaftServerMetrics>
that contains only server relatedmetrics, such as
vote
,leader
,id
,running_state
,membership
The text was updated successfully, but these errors were encountered: