Package com.codahale.metrics.health

Examples of com.codahale.metrics.health.HealthCheck


                .isEqualTo("application/json");
    }

    @Test
    public void returnsA200IfAllHealthChecksAreHealthy() throws Exception {
        registry.register("fun", new HealthCheck() {
            @Override
            protected Result check() throws Exception {
                return Result.healthy("whee");
            }
        });
View Full Code Here


                .isEqualTo("application/json");
    }

    @Test
    public void returnsA500IfAnyHealthChecksAreUnhealthy() throws Exception {
        registry.register("fun", new HealthCheck() {
            @Override
            protected Result check() throws Exception {
                return Result.healthy("whee");
            }
        });

        registry.register("notFun", new HealthCheck() {
            @Override
            protected Result check() throws Exception {
                return Result.unhealthy("whee");
            }
        });
View Full Code Here

                .isEqualTo("application/json");
    }

    @Test
    public void optionallyPrettyPrintsTheJson() throws Exception {
        registry.register("fun", new HealthCheck() {
            @Override
            protected Result check() throws Exception {
                return Result.healthy("whee");
            }
        });
View Full Code Here

    }

    private void loadHealthCheckBeans(List<String> healthChecks, ApplicationContext ctx, Environment env) {
        if (healthChecks != null) {
            for (String healthCheck : healthChecks) {
                HealthCheck healthCheckBean = (HealthCheck) ctx.getBean(healthCheck);
                env.healthChecks().register(healthCheck, healthCheckBean);
            }
        }
    }
View Full Code Here

        });
        metricRegistry.counter("counter1").inc(74);
        metricRegistry.meter("meter1");
        metricRegistry.histogram("histogram1");

        healthCheckRegistry.register("hc1", new HealthCheck() {
            @Override
            protected Result check() throws Exception {
                return Result.healthy("yay");
            }
        });
View Full Code Here

   
    MetricRegistry metricRegistry = new MetricRegistry();
    metricRegistry.register("myCounter", new Counter());
   
    HealthCheckRegistry healthChecks = new HealthCheckRegistry();
    healthChecks.register("foo", new HealthCheck() {     
      @Override
      protected Result check() throws Exception {
        return Result.healthy("flawless");
      }
    });
View Full Code Here

   
    MetricRegistry metricRegistry = new MetricRegistry();
    metricRegistry.register("myCounter", new Counter());
   
    HealthCheckRegistry healthChecks = new HealthCheckRegistry();
    healthChecks.register("foo", new HealthCheck() {     
      @Override
      protected Result check() throws Exception {
        return Result.healthy("flawless");
      }
    });
View Full Code Here

TOP

Related Classes of com.codahale.metrics.health.HealthCheck

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.