All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oath.micro.server.spring.metrics.health.HealthResource Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package com.oath.micro.server.spring.metrics.health;

import java.util.Map;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.springframework.stereotype.Component;

import com.oath.micro.server.auto.discovery.CommonRestResource;
import com.oath.micro.server.auto.discovery.SingletonRestResource;
import com.codahale.metrics.health.HealthCheck.Result;
import com.codahale.metrics.health.HealthCheckRegistry;

@Path("/health")
@Component
public class HealthResource implements CommonRestResource, SingletonRestResource {

    final HealthCheckRegistry healthChecks;

    public HealthResource(HealthCheckRegistry healthChecks) {
        this.healthChecks = healthChecks;
    }

    @GET
    @Produces("application/json")
    public Map health() {
        return healthChecks.runHealthChecks();

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy