Class SimpleMeterHealthCheck

java.lang.Object
com.codahale.metrics.health.HealthCheck
org.kiwiproject.beta.health.SimpleMeterHealthCheck

@Beta public class SimpleMeterHealthCheck extends com.codahale.metrics.health.HealthCheck
Basic health check that checks if a Meter has any errors in the last 15 minutes, calculated using the 15-minute rate from the meter. The returned results are built using HealthCheckResults so they contain a "severity" detail.
See Also:
  • HealthCheckResults
Implementation Note:
If the Meter from Metrics library uses exponentially weighted moving averages, it is actually not trivial to compute an exact number of errors in the last N time units. Here, this is using the 15-minute rate from the supplied meter and using that to estimate the number of errors. See specifically MovingAverages and Meter(MovingAverages).
  • 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
    SimpleMeterHealthCheck(String name, com.codahale.metrics.Meter meter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.codahale.metrics.health.HealthCheck.Result
     

    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

    • SimpleMeterHealthCheck

      public SimpleMeterHealthCheck(String name, com.codahale.metrics.Meter meter)
  • Method Details

    • check

      protected com.codahale.metrics.health.HealthCheck.Result check()
      Specified by:
      check in class com.codahale.metrics.health.HealthCheck