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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.codahale.metrics.health.HealthCheck.Result
    When a Result is returned it can be healthy or unhealthy.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UnhealthyCountersHealthCheck

      public UnhealthyCountersHealthCheck()
  • Method Details

    • check

      protected com.codahale.metrics.health.HealthCheck.Result check() throws Exception
      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 class com.codahale.metrics.health.HealthCheck
      Throws:
      Exception
    • recordUnhealthyCounter

      public void recordUnhealthyCounter(String counterName)
      To record a counter which might make the server unhealthy if its count is not zero.
    • recordUnhealthyProblem

      public void recordUnhealthyProblem(String className, String description)
      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 occurred
      description - a brief description of the problem