Package io.dropwizard.metrics5.health
Interface HealthCheck
- All Known Implementing Classes:
AsyncHealthCheckDecorator
,ThreadDeadlockHealthCheck
public interface HealthCheck
A health check for a component of your application.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
The result of aHealthCheck
being run.static class
This a convenient builder for anHealthCheck.Result
. -
Method Summary
Modifier and TypeMethodDescriptioncheck()
Perform a check of the application component.default io.dropwizard.metrics5.Clock
clock()
default HealthCheck.Result
execute()
Executes the health check, catching and handling any exceptions raised bycheck()
.
-
Method Details
-
check
Perform a check of the application component.- Returns:
- if the component is healthy, a healthy
HealthCheck.Result
; otherwise, an unhealthyHealthCheck.Result
with a descriptive error message or exception - Throws:
Exception
- if there is an unhandled error during the health check; this will result in a failed health check
-
execute
Executes the health check, catching and handling any exceptions raised bycheck()
.- Returns:
- if the component is healthy, a healthy
HealthCheck.Result
; otherwise, an unhealthyHealthCheck.Result
with a descriptive error message or exception
-
clock
default io.dropwizard.metrics5.Clock clock()
-