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

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

There is a newer version: 0.82.2
Show newest version
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();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy