Class: AWSCDK::CloudWatch::CommonMetricOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::CommonMetricOptions
- Defined in:
- cloud_watch/common_metric_options.rb
Overview
Options shared by most methods accepting metric options.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
Account which this metric comes from.
-
#color ⇒ String?
readonly
The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph.
-
#dimensions_map ⇒ Hash{String => String}?
readonly
Dimensions of the metric.
-
#id ⇒ String?
readonly
Unique identifier for this metric when used in dashboard widgets.
-
#label ⇒ String?
readonly
Label for this metric when added to a Graph in a Dashboard.
-
#period ⇒ AWSCDK::Duration?
readonly
The period over which the specified statistic is applied.
-
#region ⇒ String?
readonly
Region which this metric comes from.
-
#stack_account ⇒ String?
readonly
Account of the stack this metric is attached to.
-
#stack_region ⇒ String?
readonly
Region of the stack this metric is attached to.
-
#statistic ⇒ String?
readonly
What function to use for aggregating.
-
#unit ⇒ AWSCDK::CloudWatch::Unit?
readonly
Unit used to filter the metric stream.
-
#visible ⇒ Boolean?
readonly
Whether this metric should be visible in dashboard graphs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account: nil, color: nil, dimensions_map: nil, id: nil, label: nil, period: nil, region: nil, stack_account: nil, stack_region: nil, statistic: nil, unit: nil, visible: nil) ⇒ CommonMetricOptions
constructor
A new instance of CommonMetricOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account: nil, color: nil, dimensions_map: nil, id: nil, label: nil, period: nil, region: nil, stack_account: nil, stack_region: nil, statistic: nil, unit: nil, visible: nil) ⇒ CommonMetricOptions
Returns a new instance of CommonMetricOptions.
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/common_metric_options.rb', line 19 def initialize(account: nil, color: nil, dimensions_map: nil, id: nil, label: nil, period: nil, region: nil, stack_account: nil, stack_region: nil, statistic: nil, unit: nil, visible: nil) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil? @color = color Jsii::Type.check_type(@color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "color") unless @color.nil? @dimensions_map = dimensions_map Jsii::Type.check_type(@dimensions_map, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dimensionsMap") unless @dimensions_map.nil? @id = id Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") unless @id.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? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @stack_account = stack_account Jsii::Type.check_type(@stack_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stackAccount") unless @stack_account.nil? @stack_region = stack_region Jsii::Type.check_type(@stack_region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stackRegion") unless @stack_region.nil? @statistic = statistic Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic") unless @statistic.nil? @unit = unit Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Vbml0In0=")), "unit") unless @unit.nil? @visible = visible Jsii::Type.check_type(@visible, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "visible") unless @visible.nil? end |
Instance Attribute Details
#account ⇒ String? (readonly)
Default: - Deployment account.
Account which this metric comes from.
50 51 52 |
# File 'cloud_watch/common_metric_options.rb', line 50 def account @account end |
#color ⇒ String? (readonly)
Default: - Automatic color
The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.
55 56 57 |
# File 'cloud_watch/common_metric_options.rb', line 55 def color @color end |
#dimensions_map ⇒ Hash{String => String}? (readonly)
Default: - No dimensions.
Dimensions of the metric.
60 61 62 |
# File 'cloud_watch/common_metric_options.rb', line 60 def dimensions_map @dimensions_map end |
#id ⇒ String? (readonly)
Default: - No ID
Unique identifier for this metric when used in dashboard widgets.
The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.
69 70 71 |
# File 'cloud_watch/common_metric_options.rb', line 69 def id @id end |
#label ⇒ String? (readonly)
Default: - No label
Label for this metric when added to a Graph in a Dashboard.
You can use dynamic labels to show summary information about the entire 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.
85 86 87 |
# File 'cloud_watch/common_metric_options.rb', line 85 def label @label end |
#period ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(5)
The period over which the specified statistic is applied.
90 91 92 |
# File 'cloud_watch/common_metric_options.rb', line 90 def period @period end |
#region ⇒ String? (readonly)
Default: - Deployment region.
Region which this metric comes from.
95 96 97 |
# File 'cloud_watch/common_metric_options.rb', line 95 def region @region end |
#stack_account ⇒ String? (readonly)
Default: - Deployment account.
Account of the stack this metric is attached to.
100 101 102 |
# File 'cloud_watch/common_metric_options.rb', line 100 def stack_account @stack_account end |
#stack_region ⇒ String? (readonly)
Default: - Deployment region.
Region of the stack this metric is attached to.
105 106 107 |
# File 'cloud_watch/common_metric_options.rb', line 105 def stack_region @stack_region end |
#statistic ⇒ String? (readonly)
Default: Average
What function to use for aggregating.
Use the aws_cloudwatch.Stats helper class to construct valid input strings.
Can be one of the following:
- "Minimum" | "min"
- "Maximum" | "max"
- "Average" | "avg"
- "Sum" | "sum"
- "SampleCount | "n"
- "pNN.NN"
- "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
- "iqm"
- "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
- "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
- "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
126 127 128 |
# File 'cloud_watch/common_metric_options.rb', line 126 def statistic @statistic end |
#unit ⇒ AWSCDK::CloudWatch::Unit? (readonly)
Default: - All metric datums in the given metric stream
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.
The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.
CloudWatch does not honor this property for graphs.
140 141 142 |
# File 'cloud_watch/common_metric_options.rb', line 140 def unit @unit end |
#visible ⇒ Boolean? (readonly)
Default: true
Whether this metric should be visible in dashboard graphs.
Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.
148 149 150 |
# File 'cloud_watch/common_metric_options.rb', line 148 def visible @visible end |
Class Method Details
.jsii_properties ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'cloud_watch/common_metric_options.rb', line 150 def self.jsii_properties { :account => "account", :color => "color", :dimensions_map => "dimensionsMap", :id => "id", :label => "label", :period => "period", :region => "region", :stack_account => "stackAccount", :stack_region => "stackRegion", :statistic => "statistic", :unit => "unit", :visible => "visible", } end |
Instance Method Details
#to_jsii ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'cloud_watch/common_metric_options.rb', line 167 def to_jsii result = {} result.merge!({ "account" => @account, "color" => @color, "dimensionsMap" => @dimensions_map, "id" => @id, "label" => @label, "period" => @period, "region" => @region, "stackAccount" => @stack_account, "stackRegion" => @stack_region, "statistic" => @statistic, "unit" => @unit, "visible" => @visible, }) result.compact end |