Raft::RTTMonitor
Measures round-trip time to peers and auto-tunes heartbeat/election timeouts.
Only the leader sends Ping probes and computes tuned values. After
tuning, the leader distributes a ConfigUpdate RPC to all peers so the
entire cluster uses consistent timeouts (per etcd best practices).
Followers passively receive ConfigUpdate messages — they do not probe.
All nodes respond to Ping with Pong regardless of role.
Tuning formula (from etcd):
- Heartbeat interval = ~1.5x median RTT (clamped to 10ms–5000ms)
- Election timeout min = 10x median RTT
- Election timeout max = 20x median RTT
Enable via Config#rtt_tuning = true.
Constructors
Instance methods
Called by the node when a Pong is received. Records the RTT sample.