Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricStatProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/cfn_scaling_policy.rb

Overview

This structure defines the CloudWatch metric to return, along with the statistic and unit.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric: nil, stat: nil, unit: nil) ⇒ PredictiveScalingMetricStatProperty

Returns a new instance of PredictiveScalingMetricStatProperty.

Parameters:



1204
1205
1206
1207
1208
1209
1210
1211
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1204

def initialize(metric: nil, stat: nil, unit: nil)
  @metric = metric.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricProperty.new(**metric.transform_keys(&:to_sym)) : metric
  Jsii::Type.check_type(@metric, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdNZXRyaWNQcm9wZXJ0eSJ9XX19")), "metric") unless @metric.nil?
  @stat = stat
  Jsii::Type.check_type(@stat, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stat") unless @stat.nil?
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil?
end

Instance Attribute Details

#metricAWSCDK::IResolvable, ... (readonly)

The CloudWatch metric to return, including the metric name, namespace, and dimensions.

To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .



1219
1220
1221
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1219

def metric
  @metric
end

#statString? (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 metrics for predictive scaling are Average and Sum .



1228
1229
1230
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1228

def stat
  @stat
end

#unitString? (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 .



1235
1236
1237
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1235

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



1237
1238
1239
1240
1241
1242
1243
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1237

def self.jsii_properties
  {
    :metric => "metric",
    :stat => "stat",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



1245
1246
1247
1248
1249
1250
1251
1252
1253
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1245

def to_jsii
  result = {}
  result.merge!({
    "metric" => @metric,
    "stat" => @stat,
    "unit" => @unit,
  })
  result.compact
end