code: @Override
      protected Result check() throws Exception {
          final ClusterHealthStatus status = client.admin().cluster().prepareHealth().get().getStatus();
  
          if (status == ClusterHealthStatus.RED || (failOnYellow && status == ClusterHealthStatus.YELLOW)) {
              return Result.unhealthy("Last status: %s", status.name());
          } else {
              return Result.healthy("Last status: %s", status.name());
          }
      }
docs: Perform a check of the Elasticsearch cluster health.
  
  @return if the Elasticsearch cluster is healthy, a healthy {@link com.codahale.metrics.health.HealthCheck.Result};
  otherwise, an unhealthy {@link com.codahale.metrics.health.HealthCheck.Result} with a descriptive error
  message or exception
  @throws Exception if there is an unhandled error during the health check; this will result in
  a failed health check