Class TimedHealthCheck
- java.lang.Object
-
- com.codahale.metrics.health.HealthCheck
-
- org.kiwiproject.dropwizard.metrics.health.TimedHealthCheck
-
public class TimedHealthCheck extends com.codahale.metrics.health.HealthCheckHealth Check wrapper that will timeout after a set period of time.This is mainly to protect the health checks from blocking forever.
-
-
Field Summary
Fields Modifier and Type Field Description static ExecutorServiceHEALTH_CHECK_EXECUTOR
-
Constructor Summary
Constructors Constructor Description TimedHealthCheck(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.codahale.metrics.health.HealthCheck.Resultcheck()
-
-
-
Field Detail
-
HEALTH_CHECK_EXECUTOR
public static final ExecutorService HEALTH_CHECK_EXECUTOR
-
-
Constructor Detail
-
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
-
-