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

de.otto.edison.metrics.load.MetricsLoadController Maven / Gradle / Ivy

There is a newer version: 0.82.2
Show newest version
package de.otto.edison.metrics.load;

import de.otto.edison.annotations.Beta;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

@Beta
@RestController
public class MetricsLoadController {

    private LoadDetector loadDetector;

    @Autowired
    public MetricsLoadController(final LoadDetector loadDetector) {
        this.loadDetector = loadDetector;
    }

    @RequestMapping(
            value = "/internal/load",
            produces = {"application/vnd.otto.monitoring.metrics+json", "application/json"},
            method = GET
    )
    public MetricsLoadRepresentation getStatusAsJson() {
        return new MetricsLoadRepresentation(loadDetector.getStatus());
    }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy