Class: AWSCDK::Autoscaling::CfnScalingPolicy::TargetTrackingMetricStatProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Autoscaling::CfnScalingPolicy::TargetTrackingMetricStatProperty
- Defined in:
- autoscaling/cfn_scaling_policy.rb
Overview
This structure defines the CloudWatch metric to return, along with the statistic and unit.
TargetTrackingMetricStat is a property of the TargetTrackingMetricDataQuery object.
For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts in the Amazon CloudWatch User Guide .
Instance Attribute Summary collapse
-
#metric ⇒ AWSCDK::IResolvable, AWSCDK::Autoscaling::CfnScalingPolicy::MetricProperty
readonly
The metric to use.
-
#period ⇒ Numeric?
readonly
The period of the metric in seconds.
-
#stat ⇒ String
readonly
The statistic to return.
-
#unit ⇒ String?
readonly
The unit to use for the returned data points.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric:, stat:, period: nil, unit: nil) ⇒ TargetTrackingMetricStatProperty
constructor
A new instance of TargetTrackingMetricStatProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(metric:, stat:, period: nil, unit: nil) ⇒ TargetTrackingMetricStatProperty
Returns a new instance of TargetTrackingMetricStatProperty.
1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1848 def initialize(metric:, stat:, period: nil, unit: nil) @metric = metric.is_a?(Hash) ? ::AWSCDK::Autoscaling::CfnScalingPolicy::MetricProperty.new(**metric.transform_keys(&:to_sym)) : metric Jsii::Type.check_type(@metric, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5DZm5TY2FsaW5nUG9saWN5Lk1ldHJpY1Byb3BlcnR5In1dfX0=")), "metric") @stat = stat Jsii::Type.check_type(@stat, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stat") @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "period") unless @period.nil? @unit = unit Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil? end |
Instance Attribute Details
#metric ⇒ AWSCDK::IResolvable, AWSCDK::Autoscaling::CfnScalingPolicy::MetricProperty (readonly)
The metric to use.
1863 1864 1865 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1863 def metric @metric end |
#period ⇒ Numeric? (readonly)
The period of the metric in seconds.
The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see Create a target tracking policy using high-resolution metrics for faster response .
1879 1880 1881 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1879 def period @period end |
#stat ⇒ String (readonly)
The statistic to return.
It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .
The most commonly used metric for scaling is Average .
1872 1873 1874 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1872 def stat @stat end |
#unit ⇒ String? (readonly)
The unit to use for the returned data points.
For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .
1886 1887 1888 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1886 def unit @unit end |
Class Method Details
.jsii_properties ⇒ Object
1888 1889 1890 1891 1892 1893 1894 1895 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1888 def self.jsii_properties { :metric => "metric", :stat => "stat", :period => "period", :unit => "unit", } end |
Instance Method Details
#to_jsii ⇒ Object
1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 |
# File 'autoscaling/cfn_scaling_policy.rb', line 1897 def to_jsii result = {} result.merge!({ "metric" => @metric, "stat" => @stat, "period" => @period, "unit" => @unit, }) result.compact end |