Class SimpleMeterHealthCheck


  • @Beta
    public class SimpleMeterHealthCheck
    extends com.codahale.metrics.health.HealthCheck
    Very simple 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 Detail

      • SimpleMeterHealthCheck

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

      • check

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