Class ServerErrorHealthCheck


  • public class ServerErrorHealthCheck
    extends com.codahale.metrics.health.HealthCheck
    Checks for Status 5xx responses. This uses a meter which is built into Dropwizard Metrics. It is an approximation since it gives a rate instead of a count for a given time duration. This check uses the 15 minute rate on 5xx responses. Thresholds can be set for warning and critical severity. Warning threshold defaults to 1.0 and Critical defaults to 10.0.
    • 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
      ServerErrorHealthCheck​(com.codahale.metrics.MetricRegistry metrics)
      Create the health check with the given MetricRegistry, defaulting the warning and critical thresholds.
      ServerErrorHealthCheck​(com.codahale.metrics.MetricRegistry metrics, int warningThreshold, int criticalThreshold)
      Create the health check with the given MetricRegistry, warning, and critical thresholds.
    • Constructor Detail

      • ServerErrorHealthCheck

        public ServerErrorHealthCheck​(com.codahale.metrics.MetricRegistry metrics)
        Create the health check with the given MetricRegistry, defaulting the warning and critical thresholds.
        Parameters:
        metrics - the Metrics registry
      • ServerErrorHealthCheck

        public ServerErrorHealthCheck​(com.codahale.metrics.MetricRegistry metrics,
                                      int warningThreshold,
                                      int criticalThreshold)
        Create the health check with the given MetricRegistry, warning, and critical thresholds.
        Parameters:
        metrics - the Metrics registry
        warningThreshold - the threshold for a warning severity
        criticalThreshold - the threshold for a critical severity
    • Method Detail

      • check

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