Class: AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmDefinitionProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmDefinitionProperty
- Defined in:
- step_functions_tasks/emr_create_cluster.rb
Overview
The definition of a CloudWatch metric alarm, which determines when an automatic scaling activity is triggered.
When the defined alarm conditions are satisfied, scaling activity begins.
Instance Attribute Summary collapse
-
#comparison_operator ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmComparisonOperator
readonly
Determines how the metric specified by MetricName is compared to the value specified by Threshold.
-
#dimensions ⇒ Array<AWSCDK::StepFunctionsTasks::EMRCreateCluster::MetricDimensionProperty>?
readonly
A CloudWatch metric dimension.
-
#evaluation_periods ⇒ Numeric?
readonly
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity.
-
#metric_name ⇒ String
readonly
The name of the CloudWatch metric that is watched to determine an alarm condition.
-
#namespace ⇒ String?
readonly
The namespace for the CloudWatch metric.
-
#period ⇒ AWSCDK::Duration
readonly
The period, in seconds, over which the statistic is applied.
-
#statistic ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmStatistic?
readonly
The statistic to apply to the metric associated with the alarm.
-
#threshold ⇒ Numeric?
readonly
The value against which the specified statistic is compared.
-
#unit ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmUnit?
readonly
The unit of measure associated with the CloudWatch metric being watched.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(comparison_operator:, metric_name:, period:, dimensions: nil, evaluation_periods: nil, namespace: nil, statistic: nil, threshold: nil, unit: nil) ⇒ CloudWatchAlarmDefinitionProperty
constructor
A new instance of CloudWatchAlarmDefinitionProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(comparison_operator:, metric_name:, period:, dimensions: nil, evaluation_periods: nil, namespace: nil, statistic: nil, threshold: nil, unit: nil) ⇒ CloudWatchAlarmDefinitionProperty
Returns a new instance of CloudWatchAlarmDefinitionProperty.
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 867 def initialize(comparison_operator:, metric_name:, period:, dimensions: nil, evaluation_periods: nil, namespace: nil, statistic: nil, threshold: nil, unit: nil) @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5FbXJDcmVhdGVDbHVzdGVyLkNsb3VkV2F0Y2hBbGFybUNvbXBhcmlzb25PcGVyYXRvciJ9")), "comparisonOperator") @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "period") @dimensions = dimensions.is_a?(Array) ? dimensions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::StepFunctionsTasks::EMRCreateCluster::MetricDimensionProperty.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : dimensions Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zdGVwZnVuY3Rpb25zX3Rhc2tzLkVtckNyZWF0ZUNsdXN0ZXIuTWV0cmljRGltZW5zaW9uUHJvcGVydHkifSwia2luZCI6ImFycmF5In19")), "dimensions") unless @dimensions.nil? @evaluation_periods = evaluation_periods Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") unless @evaluation_periods.nil? @namespace = namespace Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil? @statistic = statistic Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5FbXJDcmVhdGVDbHVzdGVyLkNsb3VkV2F0Y2hBbGFybVN0YXRpc3RpYyJ9")), "statistic") unless @statistic.nil? @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") unless @threshold.nil? @unit = unit Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5FbXJDcmVhdGVDbHVzdGVyLkNsb3VkV2F0Y2hBbGFybVVuaXQifQ==")), "unit") unless @unit.nil? end |
Instance Attribute Details
#comparison_operator ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmComparisonOperator (readonly)
Determines how the metric specified by MetricName is compared to the value specified by Threshold.
891 892 893 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 891 def comparison_operator @comparison_operator end |
#dimensions ⇒ Array<AWSCDK::StepFunctionsTasks::EMRCreateCluster::MetricDimensionProperty>? (readonly)
Default: - No dimensions
A CloudWatch metric dimension.
907 908 909 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 907 def dimensions @dimensions end |
#evaluation_periods ⇒ Numeric? (readonly)
Default: 1
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity.
912 913 914 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 912 def evaluation_periods @evaluation_periods end |
#metric_name ⇒ String (readonly)
The name of the CloudWatch metric that is watched to determine an alarm condition.
895 896 897 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 895 def metric_name @metric_name end |
#namespace ⇒ String? (readonly)
Default: 'AWS/ElasticMapReduce'
The namespace for the CloudWatch metric.
917 918 919 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 917 def namespace @namespace end |
#period ⇒ AWSCDK::Duration (readonly)
The period, in seconds, over which the statistic is applied.
EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300.
902 903 904 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 902 def period @period end |
#statistic ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmStatistic? (readonly)
Default: CloudWatchAlarmStatistic.AVERAGE
The statistic to apply to the metric associated with the alarm.
922 923 924 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 922 def statistic @statistic end |
#threshold ⇒ Numeric? (readonly)
Default: - None
The value against which the specified statistic is compared.
927 928 929 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 927 def threshold @threshold end |
#unit ⇒ AWSCDK::StepFunctionsTasks::EMRCreateCluster::CloudWatchAlarmUnit? (readonly)
Default: CloudWatchAlarmUnit.NONE
The unit of measure associated with the CloudWatch metric being watched.
The value specified for Unit must correspond to the units specified in the CloudWatch metric.
935 936 937 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 935 def unit @unit end |
Class Method Details
.jsii_properties ⇒ Object
937 938 939 940 941 942 943 944 945 946 947 948 949 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 937 def self.jsii_properties { :comparison_operator => "comparisonOperator", :metric_name => "metricName", :period => "period", :dimensions => "dimensions", :evaluation_periods => "evaluationPeriods", :namespace => "namespace", :statistic => "statistic", :threshold => "threshold", :unit => "unit", } end |
Instance Method Details
#to_jsii ⇒ Object
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 |
# File 'step_functions_tasks/emr_create_cluster.rb', line 951 def to_jsii result = {} result.merge!({ "comparisonOperator" => @comparison_operator, "metricName" => @metric_name, "period" => @period, "dimensions" => @dimensions, "evaluationPeriods" => @evaluation_periods, "namespace" => @namespace, "statistic" => @statistic, "threshold" => @threshold, "unit" => @unit, }) result.compact end |