Package org.mapfish.print.metrics
Class UnhealthyCountersHealthCheck
java.lang.Object
com.codahale.metrics.health.HealthCheck
org.mapfish.print.metrics.UnhealthyCountersHealthCheck
public class UnhealthyCountersHealthCheck
extends com.codahale.metrics.health.HealthCheck
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.codahale.metrics.health.HealthCheck.Result
check()
When a Result is returned it can be healthy or unhealthy.void
recordUnhealthyCounter
(String counterName) To record a counter which might make the server unhealthy if its count is not zero.void
recordUnhealthyProblem
(String className, String description) Records an unhealthy problem by incrementing a counter for the given class and description.Methods inherited from class com.codahale.metrics.health.HealthCheck
clock, execute
-
Constructor Details
-
UnhealthyCountersHealthCheck
public UnhealthyCountersHealthCheck()
-
-
Method Details
-
check
When a Result is returned it can be healthy or unhealthy. In both cases it is associated to a Http 200 status. When an exception is thrown it means the server is no longer working at all, it is associated to a Http 500 status.- Specified by:
check
in classcom.codahale.metrics.health.HealthCheck
- Throws:
Exception
-
recordUnhealthyCounter
To record a counter which might make the server unhealthy if its count is not zero. -
recordUnhealthyProblem
Records an unhealthy problem by incrementing a counter for the given class and description. This method helps in tracking issues which might lead to the server being marked unhealthy.- Parameters:
className
- the name of the class where the problem occurreddescription
- a brief description of the problem
-