Class: AWSCDK::Autoscaling::ScalingInterval

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/scaling_interval.rb

Overview

A range of metric values in which to apply a certain scaling operation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(change:, lower: nil, upper: nil) ⇒ ScalingInterval

Returns a new instance of ScalingInterval.

Parameters:

  • change (Numeric)

    The capacity adjustment to apply in this interval.

  • lower (Numeric, nil) (defaults to: nil)

    The lower bound of the interval.

  • upper (Numeric, nil) (defaults to: nil)

    The upper bound of the interval.



10
11
12
13
14
15
16
17
# File 'autoscaling/scaling_interval.rb', line 10

def initialize(change:, lower: nil, upper: nil)
  @change = change
  Jsii::Type.check_type(@change, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "change")
  @lower = lower
  Jsii::Type.check_type(@lower, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "lower") unless @lower.nil?
  @upper = upper
  Jsii::Type.check_type(@upper, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "upper") unless @upper.nil?
end

Instance Attribute Details

#changeNumeric (readonly)

The capacity adjustment to apply in this interval.

The number is interpreted differently based on AdjustmentType:

  • ChangeInCapacity: add the adjustment to the current capacity. The number can be positive or negative.
  • PercentChangeInCapacity: add or remove the given percentage of the current capacity to itself. The number can be in the range [-100..100].
  • ExactCapacity: set the capacity to this number. The number must be positive.

Returns:

  • (Numeric)


31
32
33
# File 'autoscaling/scaling_interval.rb', line 31

def change
  @change
end

#lowerNumeric? (readonly)

Note:

Default: Threshold automatically derived from neighbouring intervals

The lower bound of the interval.

The scaling adjustment will be applied if the metric is higher than this value.

Returns:

  • (Numeric, nil)


38
39
40
# File 'autoscaling/scaling_interval.rb', line 38

def lower
  @lower
end

#upperNumeric? (readonly)

Note:

Default: Threshold automatically derived from neighbouring intervals

The upper bound of the interval.

The scaling adjustment will be applied if the metric is lower than this value.

Returns:

  • (Numeric, nil)


45
46
47
# File 'autoscaling/scaling_interval.rb', line 45

def upper
  @upper
end

Class Method Details

.jsii_propertiesObject



47
48
49
50
51
52
53
# File 'autoscaling/scaling_interval.rb', line 47

def self.jsii_properties
  {
    :change => "change",
    :lower => "lower",
    :upper => "upper",
  }
end

Instance Method Details

#to_jsiiObject



55
56
57
58
59
60
61
62
63
# File 'autoscaling/scaling_interval.rb', line 55

def to_jsii
  result = {}
  result.merge!({
    "change" => @change,
    "lower" => @lower,
    "upper" => @upper,
  })
  result.compact
end