de.otto.edison.metrics.load.LoadDetector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-metrics Show documentation
Show all versions of edison-metrics Show documentation
Status library of the edison-microservice project.
package de.otto.edison.metrics.load;
import com.codahale.metrics.MetricRegistry;
import de.otto.edison.annotations.Beta;
import de.otto.edison.metrics.configuration.MetricsLoadProperties;
/**
* Implementation of this interface allow to steer whether the application
* is able to run smoothly versus nearly unable to handle the load.
*/
@Beta
public interface LoadDetector {
void initialize(MetricRegistry metricRegistry, MetricsLoadProperties properties);
enum Status {
/**
* Application has less load, therefore for example the cluster might
* decide to scale down the number of instances of this application.
*/
IDLE,
/**
* Application is acting fine, no need to react for auto-scaling needs
* for example.
*/
BALANCED,
/**
* Application is overloaded.
*/
OVERLOAD
}
Status getStatus();
}