Class ManagedLeaderLatchHealthCheck
java.lang.Object
com.codahale.metrics.health.HealthCheck
org.kiwiproject.curator.leader.health.ManagedLeaderLatchHealthCheck
public class ManagedLeaderLatchHealthCheck
extends com.codahale.metrics.health.HealthCheck
Simple check to determine if the leader latch is started (healthy) or otherwise (not healthy).
The check also reports as unhealthy if there is no leader, or if Curator reports more than one leader.
The health check results contain the following details:
| Name | Description |
|---|---|
| leader | A boolean that is true if this participant is currently the leader, and false otherwise. |
| leaderParticipant | The ID of the latch participant that is the leader. This will be null if the latch is not started or if no leader is reported. |
| thisParticipant | The ID of this participant. |
| participants | A list containing the IDs of all latch participants. This will be empty if the latch is not started or if no latch participants are reported. |
-
Nested Class Summary
Nested classes/interfaces inherited from class com.codahale.metrics.health.HealthCheck
com.codahale.metrics.health.HealthCheck.Result, com.codahale.metrics.health.HealthCheck.ResultBuilder -
Constructor Summary
ConstructorsConstructorDescriptionManagedLeaderLatchHealthCheck(ManagedLeaderLatch leaderLatch) New health check instance for the given leader latch. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.codahale.metrics.health.HealthCheck.Resultcheck()Methods inherited from class com.codahale.metrics.health.HealthCheck
clock, execute
-
Constructor Details
-
ManagedLeaderLatchHealthCheck
New health check instance for the given leader latch.- Parameters:
leaderLatch- theManagedLeaderLatchto check
-
-
Method Details
-
check
protected com.codahale.metrics.health.HealthCheck.Result check()- Specified by:
checkin classcom.codahale.metrics.health.HealthCheck
-