Class: AWSCDK::CloudWatch::MathExpressionOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::MathExpressionOptions
- Defined in:
- cloud_watch/math_expression_options.rb
Overview
Configurable options for MathExpressions.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#color ⇒ String?
readonly
Color for this metric when added to a Graph in a Dashboard.
-
#label ⇒ String?
readonly
Label for this expression when added to a Graph in a Dashboard.
-
#period ⇒ AWSCDK::Duration?
readonly
The period over which the math expression's statistics are applied.
-
#search_account ⇒ String?
readonly
Account to evaluate search expressions within.
-
#search_region ⇒ String?
readonly
Region to evaluate search expressions within.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(color: nil, label: nil, period: nil, search_account: nil, search_region: nil) ⇒ MathExpressionOptions
constructor
A new instance of MathExpressionOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(color: nil, label: nil, period: nil, search_account: nil, search_region: nil) ⇒ MathExpressionOptions
Returns a new instance of MathExpressionOptions.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'cloud_watch/math_expression_options.rb', line 12 def initialize(color: nil, label: nil, period: nil, search_account: nil, search_region: nil) @color = color Jsii::Type.check_type(@color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "color") unless @color.nil? @label = label Jsii::Type.check_type(@label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "label") unless @label.nil? @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "period") unless @period.nil? @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
#color ⇒ String? (readonly)
Default: - Automatic color
Color for this metric when added to a Graph in a Dashboard.
29 30 31 |
# File 'cloud_watch/math_expression_options.rb', line 29 def color @color end |
#label ⇒ String? (readonly)
Default: - Expression value is used as label
Label for this expression when added to a Graph in a Dashboard.
If this expression evaluates to more than one time series (for
example, through the use of METRICS() or SEARCH() expressions),
each time series will appear in the graph using a combination of the
expression label and the individual metric label. Specify the empty
string ('') to suppress the expression label and only keep the
metric label.
You can use dynamic labels to show summary information about the displayed time series in the legend. For example, if you use:
[max: ${MAX}] MyMetric
As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression.
55 56 57 |
# File 'cloud_watch/math_expression_options.rb', line 55 def label @label end |
#period ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(5)
The period over which the math expression's statistics are applied.
This period overrides all periods in the metrics used in this math expression.
63 64 65 |
# File 'cloud_watch/math_expression_options.rb', line 63 def period @period end |
#search_account ⇒ String? (readonly)
Default: - Deployment account.
Account to evaluate search expressions within.
Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics).
71 72 73 |
# File 'cloud_watch/math_expression_options.rb', line 71 def search_account @search_account end |
#search_region ⇒ String? (readonly)
Default: - Deployment region.
Region to evaluate search expressions within.
Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics).
79 80 81 |
# File 'cloud_watch/math_expression_options.rb', line 79 def search_region @search_region end |
Class Method Details
.jsii_properties ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'cloud_watch/math_expression_options.rb', line 81 def self.jsii_properties { :color => "color", :label => "label", :period => "period", :search_account => "searchAccount", :search_region => "searchRegion", } end |
Instance Method Details
#to_jsii ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'cloud_watch/math_expression_options.rb', line 91 def to_jsii result = {} result.merge!({ "color" => @color, "label" => @label, "period" => @period, "searchAccount" => @search_account, "searchRegion" => @search_region, }) result.compact end |