fbpx

The scaling action to be performed can also be defined as a mathematical expression.

If you don’t want to use a static value for scaling, you can specify a scaling action parameter using expressions which will be calculated on-the-fly.

Variables

The variables we currently allow for are :

  • currCapacity – the number of active instances at the time of scaling.
  • value – the value of the metric by which this policy scales (For example, CPUUtilization).
Operators

Mathematical operations allowed:

  • Addition : +
  • Subtraction : –
  • Division : /
  • Multiplication : *
  • Power : ^
  • Square root : SQRT()
  • Conditionals : IF(boolean expression, result if true, result if false)
  • Minimum Value : MIN(v1,v2,v3…)
  • Maximum Value : MAX(v1,v2,v3…)
Examples:
  • currCapacity * 0.5
  • value * 2 + 5
  • SQRT(value * 10)
  • IF(value > 50, currCapacity * 0.6, currCapacity * 0.2)
  • MAX(value * 10, currCapacity * 3, 5)
  • IF(value > 50 && currCapacity <100, 20, 10)
Fields

The fields which accept these expressions are the following:

FieldTypeDescription
scaling.up.action.adjustmentStringMathematical expression
scaling.up.action.minTargetCapacityStringMathematical expression
scaling.up.action.targetStringMathematical expression
scaling.up.action.maximumStringMathematical expression
scaling.up.action.minimumStringMathematical expression
scaling.down.action.adjustmentStringMathematical expression
scaling.down.action.maxTargetCapacityStringMathematical expression
scaling.down.action.targetStringMathematical expression
scaling.down.action.maximumStringMathematical expression
scaling.down.action.maximumStringMathematical expression