Class: AWSCDK::OpsWorks::CfnLayer::AutoScalingThresholdsProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ops_works/cfn_layer.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cpu_threshold: nil, ignore_metrics_time: nil, instance_count: nil, load_threshold: nil, memory_threshold: nil, thresholds_wait_time: nil) ⇒ AutoScalingThresholdsProperty

Returns a new instance of AutoScalingThresholdsProperty.

Parameters:

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

    The CPU utilization threshold, as a percent of the available CPU.

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

    The amount of time (in minutes) after a scaling event occurs that OpsWorks Stacks should ignore metrics and suppress additional scaling events.

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

    The number of instances to add or remove when the load exceeds a threshold.

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

    The load threshold.

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

    The memory utilization threshold, as a percent of the available memory.

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

    The amount of time, in minutes, that the load must exceed a threshold before more instances are added or removed.



748
749
750
751
752
753
754
755
756
757
758
759
760
761
# File 'ops_works/cfn_layer.rb', line 748

def initialize(cpu_threshold: nil, ignore_metrics_time: nil, instance_count: nil, load_threshold: nil, memory_threshold: nil, thresholds_wait_time: nil)
  @cpu_threshold = cpu_threshold
  Jsii::Type.check_type(@cpu_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpuThreshold") unless @cpu_threshold.nil?
  @ignore_metrics_time = ignore_metrics_time
  Jsii::Type.check_type(@ignore_metrics_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ignoreMetricsTime") unless @ignore_metrics_time.nil?
  @instance_count = instance_count
  Jsii::Type.check_type(@instance_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "instanceCount") unless @instance_count.nil?
  @load_threshold = load_threshold
  Jsii::Type.check_type(@load_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "loadThreshold") unless @load_threshold.nil?
  @memory_threshold = memory_threshold
  Jsii::Type.check_type(@memory_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryThreshold") unless @memory_threshold.nil?
  @thresholds_wait_time = thresholds_wait_time
  Jsii::Type.check_type(@thresholds_wait_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "thresholdsWaitTime") unless @thresholds_wait_time.nil?
end

Instance Attribute Details

#cpu_thresholdNumeric? (readonly)

The CPU utilization threshold, as a percent of the available CPU.

A value of -1 disables the threshold.



769
770
771
# File 'ops_works/cfn_layer.rb', line 769

def cpu_threshold
  @cpu_threshold
end

#ignore_metrics_timeNumeric? (readonly)

The amount of time (in minutes) after a scaling event occurs that OpsWorks Stacks should ignore metrics and suppress additional scaling events.

For example, OpsWorks Stacks adds new instances following an upscaling event but the instances won't start reducing the load until they have been booted and configured. There is no point in raising additional scaling events during that operation, which typically takes several minutes. IgnoreMetricsTime allows you to direct OpsWorks Stacks to suppress scaling events long enough to get the new instances online.



776
777
778
# File 'ops_works/cfn_layer.rb', line 776

def ignore_metrics_time
  @ignore_metrics_time
end

#instance_countNumeric? (readonly)

The number of instances to add or remove when the load exceeds a threshold.



781
782
783
# File 'ops_works/cfn_layer.rb', line 781

def instance_count
  @instance_count
end

#load_thresholdNumeric? (readonly)

The load threshold.

A value of -1 disables the threshold. For more information about how load is computed, see Load (computing) .



788
789
790
# File 'ops_works/cfn_layer.rb', line 788

def load_threshold
  @load_threshold
end

#memory_thresholdNumeric? (readonly)

The memory utilization threshold, as a percent of the available memory.

A value of -1 disables the threshold.



795
796
797
# File 'ops_works/cfn_layer.rb', line 795

def memory_threshold
  @memory_threshold
end

#thresholds_wait_timeNumeric? (readonly)

The amount of time, in minutes, that the load must exceed a threshold before more instances are added or removed.



800
801
802
# File 'ops_works/cfn_layer.rb', line 800

def thresholds_wait_time
  @thresholds_wait_time
end

Class Method Details

.jsii_propertiesObject



802
803
804
805
806
807
808
809
810
811
# File 'ops_works/cfn_layer.rb', line 802

def self.jsii_properties
  {
    :cpu_threshold => "cpuThreshold",
    :ignore_metrics_time => "ignoreMetricsTime",
    :instance_count => "instanceCount",
    :load_threshold => "loadThreshold",
    :memory_threshold => "memoryThreshold",
    :thresholds_wait_time => "thresholdsWaitTime",
  }
end

Instance Method Details

#to_jsiiObject



813
814
815
816
817
818
819
820
821
822
823
824
# File 'ops_works/cfn_layer.rb', line 813

def to_jsii
  result = {}
  result.merge!({
    "cpuThreshold" => @cpu_threshold,
    "ignoreMetricsTime" => @ignore_metrics_time,
    "instanceCount" => @instance_count,
    "loadThreshold" => @load_threshold,
    "memoryThreshold" => @memory_threshold,
    "thresholdsWaitTime" => @thresholds_wait_time,
  })
  result.compact
end