Package com.codahale.metrics.health.HealthCheck

Examples of com.codahale.metrics.health.HealthCheck.Result


     * @return a map of the health check results
     */
    public SortedMap<String, HealthCheck.Result> runHealthChecks() {
        final SortedMap<String, HealthCheck.Result> results = new TreeMap<String, HealthCheck.Result>();
        for (Map.Entry<String, HealthCheck> entry : healthChecks.entrySet()) {
            final Result result = entry.getValue().execute();
            results.put(entry.getKey(), result);
        }
        return Collections.unmodifiableSortedMap(results);
    }
View Full Code Here


  HealthCheckRegistry healthCheckRegistry;

  @Test
  public void testHealthy() {
    healthCheckClass.setShouldFail(false);
    Result result = healthCheckRegistry.runHealthCheck("myHealthCheckClass");
    assertTrue(result.isHealthy());
  }
View Full Code Here

  }

  @Test
  public void testUnhealthy() {
    healthCheckClass.setShouldFail(true);
    Result result = healthCheckRegistry.runHealthCheck("myHealthCheckClass");
    assertFalse(result.isHealthy());
    assertEquals("fail whale", result.getMessage());
  }
View Full Code Here

     * @return a map of the health check results
     */
    public SortedMap<String, HealthCheck.Result> runHealthChecks() {
        final SortedMap<String, HealthCheck.Result> results = new TreeMap<String, HealthCheck.Result>();
        for (Map.Entry<String, HealthCheck> entry : healthChecks.entrySet()) {
            final Result result = entry.getValue().execute();
            results.put(entry.getKey(), result);
        }
        return Collections.unmodifiableSortedMap(results);
    }
View Full Code Here

TOP

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

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.