Class: AWSCDK::CloudWatch::MetricStatConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::MetricStatConfig
- Defined in:
- cloud_watch/metric_stat_config.rb
Overview
Properties for a concrete metric.
NOTE: unit is no longer on this object since it is only used for Alarms, and doesn't mean what one
would expect it to mean there anyway. It is most likely to be misused.
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
Account which this metric comes from.
-
#account_override ⇒ String?
readonly
Account set directly on the metric, not inherited from the attached stack.
-
#dimensions ⇒ Array<AWSCDK::CloudWatch::Dimension>?
readonly
The dimensions to apply to the alarm.
-
#metric_name ⇒ String
readonly
Name of the metric.
-
#namespace ⇒ String
readonly
Namespace of the metric.
-
#period ⇒ AWSCDK::Duration
readonly
How many seconds to aggregate over.
-
#region ⇒ String?
readonly
Region which this metric comes from.
-
#region_override ⇒ String?
readonly
Region set directly on the metric, not inherited from the attached stack.
-
#statistic ⇒ String
readonly
Aggregation function to use (can be either simple or a percentile).
-
#unit_filter ⇒ AWSCDK::CloudWatch::Unit?
readonly
Unit used to filter the metric stream.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric_name:, namespace:, period:, statistic:, account: nil, account_override: nil, dimensions: nil, region: nil, region_override: nil, unit_filter: nil) ⇒ MetricStatConfig
constructor
A new instance of MetricStatConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(metric_name:, namespace:, period:, statistic:, account: nil, account_override: nil, dimensions: nil, region: nil, region_override: nil, unit_filter: nil) ⇒ MetricStatConfig
Returns a new instance of MetricStatConfig.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'cloud_watch/metric_stat_config.rb', line 20 def initialize(metric_name:, namespace:, period:, statistic:, account: nil, account_override: nil, dimensions: nil, region: nil, region_override: nil, unit_filter: nil) @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") @namespace = namespace Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "period") @statistic = statistic Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic") @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil? @account_override = account_override Jsii::Type.check_type(@account_override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountOverride") unless @account_override.nil? @dimensions = dimensions.is_a?(Array) ? dimensions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudWatch::Dimension.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : dimensions Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLkRpbWVuc2lvbiJ9LCJraW5kIjoiYXJyYXkifX0=")), "dimensions") unless @dimensions.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @region_override = region_override Jsii::Type.check_type(@region_override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "regionOverride") unless @region_override.nil? @unit_filter = unit_filter Jsii::Type.check_type(@unit_filter, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Vbml0In0=")), "unitFilter") unless @unit_filter.nil? end |
Instance Attribute Details
#account ⇒ String? (readonly)
Default: Deployment account.
Account which this metric comes from.
63 64 65 |
# File 'cloud_watch/metric_stat_config.rb', line 63 def account @account end |
#account_override ⇒ String? (readonly)
Default: No override.
Account set directly on the metric, not inherited from the attached stack.
68 69 70 |
# File 'cloud_watch/metric_stat_config.rb', line 68 def account_override @account_override end |
#dimensions ⇒ Array<AWSCDK::CloudWatch::Dimension>? (readonly)
Default: []
The dimensions to apply to the alarm.
73 74 75 |
# File 'cloud_watch/metric_stat_config.rb', line 73 def dimensions @dimensions end |
#metric_name ⇒ String (readonly)
Name of the metric.
46 47 48 |
# File 'cloud_watch/metric_stat_config.rb', line 46 def metric_name @metric_name end |
#namespace ⇒ String (readonly)
Namespace of the metric.
50 51 52 |
# File 'cloud_watch/metric_stat_config.rb', line 50 def namespace @namespace end |
#period ⇒ AWSCDK::Duration (readonly)
How many seconds to aggregate over.
54 55 56 |
# File 'cloud_watch/metric_stat_config.rb', line 54 def period @period end |
#region ⇒ String? (readonly)
Default: Deployment region.
Region which this metric comes from.
78 79 80 |
# File 'cloud_watch/metric_stat_config.rb', line 78 def region @region end |
#region_override ⇒ String? (readonly)
Default: No override.
Region set directly on the metric, not inherited from the attached stack.
83 84 85 |
# File 'cloud_watch/metric_stat_config.rb', line 83 def region_override @region_override end |
#statistic ⇒ String (readonly)
Aggregation function to use (can be either simple or a percentile).
58 59 60 |
# File 'cloud_watch/metric_stat_config.rb', line 58 def statistic @statistic end |
#unit_filter ⇒ AWSCDK::CloudWatch::Unit? (readonly)
Default: - Refer to all metric datums
Unit used to filter the metric stream.
Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.
This field has been renamed from plain unit to clearly communicate
its purpose.
95 96 97 |
# File 'cloud_watch/metric_stat_config.rb', line 95 def unit_filter @unit_filter end |
Class Method Details
.jsii_properties ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'cloud_watch/metric_stat_config.rb', line 97 def self.jsii_properties { :metric_name => "metricName", :namespace => "namespace", :period => "period", :statistic => "statistic", :account => "account", :account_override => "accountOverride", :dimensions => "dimensions", :region => "region", :region_override => "regionOverride", :unit_filter => "unitFilter", } end |
Instance Method Details
#to_jsii ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'cloud_watch/metric_stat_config.rb', line 112 def to_jsii result = {} result.merge!({ "metricName" => @metric_name, "namespace" => @namespace, "period" => @period, "statistic" => @statistic, "account" => @account, "accountOverride" => @account_override, "dimensions" => @dimensions, "region" => @region, "regionOverride" => @region_override, "unitFilter" => @unit_filter, }) result.compact end |