Class: AWSCDK::CloudWatch::MetricExpressionConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::MetricExpressionConfig
- Defined in:
- cloud_watch/metric_expression_config.rb
Overview
Properties for a concrete metric.
Instance Attribute Summary collapse
-
#expression ⇒ String
readonly
Math expression for the metric.
-
#period ⇒ Numeric
readonly
How many seconds to aggregate over.
-
#search_account ⇒ String?
readonly
Account to evaluate search expressions within.
-
#search_region ⇒ String?
readonly
Region to evaluate search expressions within.
-
#using_metrics ⇒ Hash{String => AWSCDK::CloudWatch::IMetric}
readonly
Metrics used in the math expression.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(expression:, period:, using_metrics:, search_account: nil, search_region: nil) ⇒ MetricExpressionConfig
constructor
A new instance of MetricExpressionConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(expression:, period:, using_metrics:, search_account: nil, search_region: nil) ⇒ MetricExpressionConfig
Returns a new instance of MetricExpressionConfig.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'cloud_watch/metric_expression_config.rb', line 12 def initialize(expression:, period:, using_metrics:, search_account: nil, search_region: nil) @expression = expression Jsii::Type.check_type(@expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression") @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "period") @using_metrics = using_metrics Jsii::Type.check_type(@using_metrics, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLklNZXRyaWMifSwia2luZCI6Im1hcCJ9fQ==")), "usingMetrics") @search_account = search_account Jsii::Type.check_type(@search_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "searchAccount") unless @search_account.nil? @search_region = search_region Jsii::Type.check_type(@search_region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "searchRegion") unless @search_region.nil? end |
Instance Attribute Details
#expression ⇒ String (readonly)
Math expression for the metric.
28 29 30 |
# File 'cloud_watch/metric_expression_config.rb', line 28 def expression @expression end |
#period ⇒ Numeric (readonly)
How many seconds to aggregate over.
32 33 34 |
# File 'cloud_watch/metric_expression_config.rb', line 32 def period @period end |
#search_account ⇒ String? (readonly)
Note:
Default: - Deployment account.
Account to evaluate search expressions within.
41 42 43 |
# File 'cloud_watch/metric_expression_config.rb', line 41 def search_account @search_account end |
#search_region ⇒ String? (readonly)
Note:
Default: - Deployment region.
Region to evaluate search expressions within.
46 47 48 |
# File 'cloud_watch/metric_expression_config.rb', line 46 def search_region @search_region end |
#using_metrics ⇒ Hash{String => AWSCDK::CloudWatch::IMetric} (readonly)
Metrics used in the math expression.
36 37 38 |
# File 'cloud_watch/metric_expression_config.rb', line 36 def using_metrics @using_metrics end |
Class Method Details
.jsii_properties ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'cloud_watch/metric_expression_config.rb', line 48 def self.jsii_properties { :expression => "expression", :period => "period", :using_metrics => "usingMetrics", :search_account => "searchAccount", :search_region => "searchRegion", } end |
Instance Method Details
#to_jsii ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'cloud_watch/metric_expression_config.rb', line 58 def to_jsii result = {} result.merge!({ "expression" => @expression, "period" => @period, "usingMetrics" => @using_metrics, "searchAccount" => @search_account, "searchRegion" => @search_region, }) result.compact end |