Class TimedHealthCheck
java.lang.Object
com.codahale.metrics.health.HealthCheck
org.kiwiproject.dropwizard.metrics.health.TimedHealthCheck
public class TimedHealthCheck
extends com.codahale.metrics.health.HealthCheck
Health Check wrapper that will time out after a set period of time.
This is mainly to protect the health checks from blocking forever.
-
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 -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimedHealthCheck(com.codahale.metrics.health.HealthCheck delegate) Creates a new TimedHealthCheck with the givendelegateHealthCheckand the default timeout (5 seconds).TimedHealthCheck(com.codahale.metrics.health.HealthCheck delegate, io.dropwizard.util.Duration timeout) Creates a new TimedHealthCheck with the given (delegateHealthCheckand the giventimeout. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.codahale.metrics.health.HealthCheck.Resultcheck()Methods inherited from class com.codahale.metrics.health.HealthCheck
clock, execute
-
Field Details
-
HEALTH_CHECK_EXECUTOR
-
-
Constructor Details
-
TimedHealthCheck
public TimedHealthCheck(com.codahale.metrics.health.HealthCheck delegate) Creates a new TimedHealthCheck with the givendelegateHealthCheckand the default timeout (5 seconds).- Parameters:
delegate- the target health check
-
TimedHealthCheck
public TimedHealthCheck(com.codahale.metrics.health.HealthCheck delegate, io.dropwizard.util.Duration timeout) Creates a new TimedHealthCheck with the given (delegateHealthCheckand the giventimeout.- Parameters:
delegate- the target health checktimeout- the timeout to use
-
-
Method Details
-
check
protected com.codahale.metrics.health.HealthCheck.Result check()- Specified by:
checkin classcom.codahale.metrics.health.HealthCheck
-