Class RuleBasedPredictorParams


  • public class RuleBasedPredictorParams
    extends java.lang.Object
    Represents PredictorConfig parameters for a RuleBasedPredictor.
    • Field Detail

      • DEFAULT_COOLDOWN_PERIOD

        public static final com.elastisys.scale.commons.json.types.TimeInterval DEFAULT_COOLDOWN_PERIOD
    • Constructor Detail

      • RuleBasedPredictorParams

        public RuleBasedPredictorParams​(com.elastisys.scale.commons.json.types.TimeInterval cooldownPeriod,
                                        java.util.List<ScalingRule> scalingRules)
        Constructs a new RuleBasedPredictor.
        Parameters:
        cooldownPeriod - The time period that the RuleBasedPredictor will remain passive after a scaling rule has been triggered, in order to allow changes to have a chance to take effect before another scaling rule is triggered. May be null. Default is DEFAULT_COOLDOWN_PERIOD.
        scalingRules - The collection of ScalingRules to be enforced. The ScalingRules are evaluated in order by the RuleBasedPredictor.

        During a prediction iteration, the first ScalingRule to be satisfied is triggered (the rest are ignored) and marks the start of a cooldown period. May be null, which is equivalent to giving an empty list.

    • Method Detail

      • validate

        public void validate()
                      throws java.lang.IllegalArgumentException
        Performs basic validation of this RuleBasedPredictorParams.
        Throws:
        java.lang.IllegalArgumentException - if validation fails.
      • getCooldownPeriod

        public com.elastisys.scale.commons.json.types.TimeInterval getCooldownPeriod()
        Returns the time period that the RuleBasedPredictor will remain passive after a scaling rule has been triggered, in order to allow changes to have a chance to take effect before another scaling rule is triggered.
        Returns:
      • getScalingRules

        public java.util.List<ScalingRule> getScalingRules()
        Returns the collection of ScalingRules to be enforced. The ScalingRules are evaluated in order by the RuleBasedPredictor.

        During a prediction iteration, the first ScalingRule to be satisfied is triggered (the rest are ignored) and marks the start of a cooldown period.

        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object