Class ReactivePredictor
- java.lang.Object
-
- com.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor
-
- com.elastisys.autoscaler.predictors.reactive.ReactivePredictor
-
- All Implemented Interfaces:
com.elastisys.autoscaler.core.api.Configurable<com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig>,com.elastisys.autoscaler.core.api.Service<com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig>,com.elastisys.autoscaler.core.prediction.impl.standard.api.Predictor
public class ReactivePredictor extends com.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictorA naivePredictorthat simply uses the latest observed metric value as the predicted future value (using a "tomorrow will probably be very similar to today"-style heuristic) combined with adding some optional safety margin to try and stay "above the load curve". To keep some margin to the load curve asafetyMargincan optionally be set in theReactivePredictorParams, which will add some extra padding to every prediction If metric values are sparse, a sufficiently long lookbackWindow should be specified so that the predictor can initialize on start-up.
-
-
Constructor Summary
Constructors Constructor Description ReactivePredictor(org.slf4j.Logger logger, com.elastisys.scale.commons.eventbus.EventBus eventBus, com.elastisys.autoscaler.core.monitoring.api.MonitoringSubsystem monitoringSubsystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyConfig(com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig newConfig)java.util.Optional<com.elastisys.autoscaler.core.prediction.api.types.Prediction>doPrediction(java.util.Optional<com.elastisys.scale.cloudpool.api.types.PoolSizeSummary> poolSize, org.joda.time.DateTime predictionTime)voidonStart(com.elastisys.autoscaler.core.monitoring.metricstreamer.reader.MetricStreamReader metricReader)voidonStop()voidvalidateConfig(com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig configuration)
-
-
-
Method Detail
-
validateConfig
public void validateConfig(com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig configuration) throws java.lang.IllegalArgumentException- Specified by:
validateConfigin classcom.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor- Throws:
java.lang.IllegalArgumentException
-
applyConfig
public void applyConfig(com.elastisys.autoscaler.core.prediction.impl.standard.config.PredictorConfig newConfig) throws java.lang.IllegalArgumentException- Specified by:
applyConfigin classcom.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor- Throws:
java.lang.IllegalArgumentException
-
onStart
public void onStart(com.elastisys.autoscaler.core.monitoring.metricstreamer.reader.MetricStreamReader metricReader)
- Specified by:
onStartin classcom.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor
-
onStop
public void onStop()
- Specified by:
onStopin classcom.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor
-
doPrediction
public java.util.Optional<com.elastisys.autoscaler.core.prediction.api.types.Prediction> doPrediction(java.util.Optional<com.elastisys.scale.cloudpool.api.types.PoolSizeSummary> poolSize, org.joda.time.DateTime predictionTime) throws com.elastisys.autoscaler.core.prediction.api.PredictionException- Specified by:
doPredictionin classcom.elastisys.autoscaler.core.prediction.impl.standard.predictor.AbstractPredictor- Throws:
com.elastisys.autoscaler.core.prediction.api.PredictionException
-
-