class

Raft::Metrics

Inherits Reference < Object

Observable counters and state for a Raft node.

Access via Node#metrics. Counters are incremented internally as the node operates. All fields are readable and can be scraped for monitoring.

Instance methods

batches_processed

Number of times a client-request batch was processed by the leader. Each batch may contain one or more proposals. For concurrent workloads, this should be less than proposals_committed when batching is active.

Source
batches_processed=(batches_processed : UInt64)

Number of times a client-request batch was processed by the leader. Each batch may contain one or more proposals. For concurrent workloads, this should be less than proposals_committed when batching is active.

Source
commit_index

Index of the highest committed log entry.

Source
commit_index=(commit_index : UInt64)

Index of the highest committed log entry.

Source
elections_started

Number of elections this node has initiated.

Source
elections_started=(elections_started : UInt64)

Number of elections this node has initiated.

Source
elections_won

Number of elections this node has won (became leader).

Source
elections_won=(elections_won : UInt64)

Number of elections this node has won (became leader).

Source
entries_applied

Total number of log entries applied to the state machine.

Source
entries_applied=(entries_applied : UInt64)

Total number of log entries applied to the state machine.

Source
proposals_committed

Number of client proposals that were committed and applied.

Source
proposals_committed=(proposals_committed : UInt64)

Number of client proposals that were committed and applied.

Source
role

Current role as a string: "follower", "candidate", or "leader".

Source
role=(role : String)

Current role as a string: "follower", "candidate", or "leader".

Source
snapshots_installed

Number of snapshots installed from a leader.

Source
snapshots_installed=(snapshots_installed : UInt64)

Number of snapshots installed from a leader.

Source
term

Current Raft term.

Source
term=(term : UInt64)

Current Raft term.

Source
to_h

Returns all metrics as a flat hash.

Source