Class: AWSCDK::CloudWatch::AnomalyDetectionAlarmProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::AnomalyDetectionAlarmProps
- Defined in:
- cloud_watch/anomaly_detection_alarm_props.rb
Overview
Properties for Anomaly Detection Alarms.
Instance Attribute Summary collapse
-
#actions_enabled ⇒ Boolean?
readonly
Whether the actions for this alarm are enabled.
-
#alarm_description ⇒ String?
readonly
Description for the alarm.
-
#alarm_name ⇒ String?
readonly
Name of the alarm.
-
#comparison_operator ⇒ AWSCDK::CloudWatch::ComparisonOperator?
readonly
Comparison operator to use to check if metric is breaching.
-
#datapoints_to_alarm ⇒ Numeric?
readonly
The number of datapoints that must be breaching to trigger the alarm.
-
#evaluate_low_sample_count_percentile ⇒ String?
readonly
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
-
#evaluation_periods ⇒ Numeric
readonly
The number of periods over which data is compared to the specified threshold.
-
#metric ⇒ AWSCDK::CloudWatch::IMetric
readonly
The metric to add the alarm on.
-
#period ⇒ AWSCDK::Duration?
readonly
deprecated
Deprecated.
Use
metric.with({ period: ... })to encode the period into the Metric object -
#statistic ⇒ String?
readonly
deprecated
Deprecated.
Use
metric.with({ statistic: ... })to encode the period into the Metric object -
#std_devs ⇒ Numeric?
readonly
The number of standard deviations to use for the anomaly detection band.
-
#treat_missing_data ⇒ AWSCDK::CloudWatch::TreatMissingData?
readonly
Sets how this alarm is to handle missing data points.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(evaluation_periods:, metric:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, period: nil, statistic: nil, std_devs: nil, treat_missing_data: nil) ⇒ AnomalyDetectionAlarmProps
constructor
A new instance of AnomalyDetectionAlarmProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(evaluation_periods:, metric:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, period: nil, statistic: nil, std_devs: nil, treat_missing_data: nil) ⇒ AnomalyDetectionAlarmProps
Returns a new instance of AnomalyDetectionAlarmProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 19 def initialize(evaluation_periods:, metric:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, period: nil, statistic: nil, std_devs: nil, treat_missing_data: nil) @evaluation_periods = evaluation_periods Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") @metric = metric Jsii::Type.check_type(@metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "metric") @actions_enabled = actions_enabled Jsii::Type.check_type(@actions_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "actionsEnabled") unless @actions_enabled.nil? @alarm_description = alarm_description Jsii::Type.check_type(@alarm_description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmDescription") unless @alarm_description.nil? @alarm_name = alarm_name Jsii::Type.check_type(@alarm_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmName") unless @alarm_name.nil? @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Db21wYXJpc29uT3BlcmF0b3IifQ==")), "comparisonOperator") unless @comparison_operator.nil? @datapoints_to_alarm = datapoints_to_alarm Jsii::Type.check_type(@datapoints_to_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "datapointsToAlarm") unless @datapoints_to_alarm.nil? @evaluate_low_sample_count_percentile = evaluate_low_sample_count_percentile Jsii::Type.check_type(@evaluate_low_sample_count_percentile, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "evaluateLowSampleCountPercentile") unless @evaluate_low_sample_count_percentile.nil? @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "period") unless @period.nil? @statistic = statistic Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic") unless @statistic.nil? @std_devs = std_devs Jsii::Type.check_type(@std_devs, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "stdDevs") unless @std_devs.nil? @treat_missing_data = treat_missing_data Jsii::Type.check_type(@treat_missing_data, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UcmVhdE1pc3NpbmdEYXRhIn0=")), "treatMissingData") unless @treat_missing_data.nil? end |
Instance Attribute Details
#actions_enabled ⇒ Boolean? (readonly)
Default: true
Whether the actions for this alarm are enabled.
61 62 63 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 61 def actions_enabled @actions_enabled end |
#alarm_description ⇒ String? (readonly)
Default: No description
Description for the alarm.
66 67 68 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 66 def alarm_description @alarm_description end |
#alarm_name ⇒ String? (readonly)
Default: Automatically generated name
Name of the alarm.
71 72 73 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 71 def alarm_name @alarm_name end |
#comparison_operator ⇒ AWSCDK::CloudWatch::ComparisonOperator? (readonly)
Default: LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD
Comparison operator to use to check if metric is breaching.
Must be one of the anomaly detection operators:
- LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD
- GREATER_THAN_UPPER_THRESHOLD
- LESS_THAN_LOWER_THRESHOLD
82 83 84 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 82 def comparison_operator @comparison_operator end |
#datapoints_to_alarm ⇒ Numeric? (readonly)
Default: evaluationPeriods
The number of datapoints that must be breaching to trigger the alarm.
This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
92 93 94 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 92 def datapoints_to_alarm @datapoints_to_alarm end |
#evaluate_low_sample_count_percentile ⇒ String? (readonly)
Default: - Not configured.
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
Used only for alarms that are based on percentiles.
99 100 101 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 99 def evaluate_low_sample_count_percentile @evaluate_low_sample_count_percentile end |
#evaluation_periods ⇒ Numeric (readonly)
The number of periods over which data is compared to the specified threshold.
49 50 51 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 49 def evaluation_periods @evaluation_periods end |
#metric ⇒ AWSCDK::CloudWatch::IMetric (readonly)
The metric to add the alarm on.
Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
56 57 58 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 56 def metric @metric end |
#period ⇒ AWSCDK::Duration? (readonly)
Use metric.with({ period: ... }) to encode the period into the Metric object
Default: - The period from the metric
The period over which the specified statistic is applied.
Cannot be used with MathExpression objects.
107 108 109 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 107 def period @period end |
#statistic ⇒ String? (readonly)
Use metric.with({ statistic: ... }) to encode the period into the Metric object
Default: - The statistic from the metric
What function to use for aggregating.
Can be one of the following:
- "Minimum" | "min"
- "Maximum" | "max"
- "Average" | "avg"
- "Sum" | "sum"
- "SampleCount | "n"
- "pNN.NN"
Cannot be used with MathExpression objects.
124 125 126 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 124 def statistic @statistic end |
#std_devs ⇒ Numeric? (readonly)
Default: 2
The number of standard deviations to use for the anomaly detection band.
The higher the value, the wider the band.
- Must be greater than 0. A value of 0 or negative values would not make sense in the context of calculating standard deviations.
- There is no strict maximum value defined, as standard deviations can theoretically extend infinitely. However, in practice, values beyond 5 or 6 standard deviations are rarely used, as they would result in an extremely wide anomaly detection band, potentially missing significant anomalies.
134 135 136 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 134 def std_devs @std_devs end |
#treat_missing_data ⇒ AWSCDK::CloudWatch::TreatMissingData? (readonly)
Default: TreatMissingData.Missing
Sets how this alarm is to handle missing data points.
139 140 141 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 139 def treat_missing_data @treat_missing_data end |
Class Method Details
.jsii_properties ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 141 def self.jsii_properties { :evaluation_periods => "evaluationPeriods", :metric => "metric", :actions_enabled => "actionsEnabled", :alarm_description => "alarmDescription", :alarm_name => "alarmName", :comparison_operator => "comparisonOperator", :datapoints_to_alarm => "datapointsToAlarm", :evaluate_low_sample_count_percentile => "evaluateLowSampleCountPercentile", :period => "period", :statistic => "statistic", :std_devs => "stdDevs", :treat_missing_data => "treatMissingData", } end |
Instance Method Details
#to_jsii ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'cloud_watch/anomaly_detection_alarm_props.rb', line 158 def to_jsii result = {} result.merge!({ "evaluationPeriods" => @evaluation_periods, "metric" => @metric, "actionsEnabled" => @actions_enabled, "alarmDescription" => @alarm_description, "alarmName" => @alarm_name, "comparisonOperator" => @comparison_operator, "datapointsToAlarm" => @datapoints_to_alarm, "evaluateLowSampleCountPercentile" => @evaluate_low_sample_count_percentile, "period" => @period, "statistic" => @statistic, "stdDevs" => @std_devs, "treatMissingData" => @treat_missing_data, }) result.compact end |