Class JGroupsRaftMetrics.DisabledJGroupsRaftMetrics
- All Implemented Interfaces:
JGroupsRaftMetrics
- Enclosing interface:
JGroupsRaftMetrics
- Since:
- 2.0
- Author:
- José Bolina
-
Nested Class Summary
Nested classes/interfaces inherited from interface JGroupsRaftMetrics
JGroupsRaftMetrics.DisabledJGroupsRaftMetrics -
Field Summary
Fields inherited from interface JGroupsRaftMetrics
METRICS_ENABLED, METRICS_PROPERTY_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionintThe number of nodes currently reachable in the cluster view.intThe total number of nodes configured in the cluster, excluding learners.Metrics about the current leader and election timing.Latency measurements for the main operations: request processing, consensus, leader election, and request forwarding.Metrics about the Raft log, including entry counts and replication progress.voidreset()Resets all collected metrics to their initial state.
-
Method Details
-
getTotalNodes
public int getTotalNodes()Description copied from interface:JGroupsRaftMetricsThe total number of nodes configured in the cluster, excluding learners.This value reflects the static Raft membership. The member in the list include only the voting members of the algorithm. This list reflects the currently configured members, and as such, it only changes through membership operation submitted through
JGroupsRaftAdministration. TheJGroupsRaftMetrics.getActiveNodes()returns a live view of the cluster members.- Specified by:
getTotalNodesin interfaceJGroupsRaftMetrics- Returns:
- the configured cluster size, or
-1if metrics are disabled.
-
getActiveNodes
public int getActiveNodes()Description copied from interface:JGroupsRaftMetricsThe number of nodes currently reachable in the cluster view.Compare this value against
JGroupsRaftMetrics.getTotalNodes()to detect membership degradation. When active nodes drop below the majority threshold (totalNodes / 2 + 1), the cluster becomes unavailable until enough members rejoin. Monitoring this metric is essential for alerting on availability risks before the cluster loses quorum.- Specified by:
getActiveNodesin interfaceJGroupsRaftMetrics- Returns:
- the number of active nodes (including learners), or
-1if metrics are disabled.
-
leaderMetrics
Description copied from interface:JGroupsRaftMetricsMetrics about the current leader and election timing.Use these metrics to identify the current leader, determine when the last election occurred, and detect leadership instability. Frequent leader changes may indicate network issues or misconfigured failure detectors, and each election causes a brief period where operations are unavailable.
- Specified by:
leaderMetricsin interfaceJGroupsRaftMetrics- Returns:
- the leader election metrics; never
null. - See Also:
-
replicationMetrics
Description copied from interface:JGroupsRaftMetricsMetrics about the Raft log, including entry counts and replication progress.Use these metrics to monitor replication health. A growing gap between total and replicated entries indicates that followers are falling behind.
- Specified by:
replicationMetricsin interfaceJGroupsRaftMetrics- Returns:
- the log replication metrics; never
null. - See Also:
-
performanceMetrics
Description copied from interface:JGroupsRaftMetricsLatency measurements for the main operations: request processing, consensus, leader election, and request forwarding.Use these metrics to identify performance bottlenecks and validate SLAs. Comparing the different latency categories helps pinpoint whether delays originate from consensus, request queuing, or network forwarding. See
PerformanceMetricsfor details on each category.- Specified by:
performanceMetricsin interfaceJGroupsRaftMetrics- Returns:
- the performance metrics; never
null. - See Also:
-
reset
public void reset()Description copied from interface:JGroupsRaftMetricsResets all collected metrics to their initial state.Clears latency histograms, counters, and any accumulated statistics across all metric categories (election, log, performance). Membership metrics (
JGroupsRaftMetrics.getTotalNodes(),JGroupsRaftMetrics.getActiveNodes()) are not affected since they reflect live cluster state rather than accumulated measurements.This is useful for establishing a clean baseline after configuration changes, deployments, or when investigating a specific time window. Has no effect when metrics are disabled.
- Specified by:
resetin interfaceJGroupsRaftMetrics
-