Class: AWSCDK::GameLift::CfnContainerFleet::ScalingPolicyProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::GameLift::CfnContainerFleet::ScalingPolicyProperty
- Defined in:
- game_lift/cfn_container_fleet.rb
Overview
Rule that controls how a fleet is scaled.
Scaling policies are uniquely identified by the combination of name and fleet ID.
Instance Attribute Summary collapse
-
#comparison_operator ⇒ String?
readonly
Comparison operator to use when measuring a metric against the threshold value.
-
#evaluation_periods ⇒ Numeric?
readonly
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
-
#metric_name ⇒ String
readonly
Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment.
-
#name ⇒ String
readonly
A descriptive label that is associated with a fleet's scaling policy.
-
#policy_type ⇒ String?
readonly
The type of scaling policy to create.
-
#scaling_adjustment ⇒ Numeric?
readonly
Amount of adjustment to make, based on the scaling adjustment type.
-
#scaling_adjustment_type ⇒ String?
readonly
The type of adjustment to make to a fleet's instance count.
-
#target_configuration ⇒ AWSCDK::IResolvable, ...
readonly
An object that contains settings for a target-based scaling policy.
-
#threshold ⇒ Numeric?
readonly
Metric value used to trigger a scaling event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, target_configuration: nil, threshold: nil) ⇒ ScalingPolicyProperty
constructor
A new instance of ScalingPolicyProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, target_configuration: nil, threshold: nil) ⇒ ScalingPolicyProperty
Returns a new instance of ScalingPolicyProperty.
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 |
# File 'game_lift/cfn_container_fleet.rb', line 1348 def initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, target_configuration: nil, threshold: nil) @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator") unless @comparison_operator.nil? @evaluation_periods = evaluation_periods Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") unless @evaluation_periods.nil? @policy_type = policy_type Jsii::Type.check_type(@policy_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyType") unless @policy_type.nil? @scaling_adjustment = scaling_adjustment Jsii::Type.check_type(@scaling_adjustment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "scalingAdjustment") unless @scaling_adjustment.nil? @scaling_adjustment_type = scaling_adjustment_type Jsii::Type.check_type(@scaling_adjustment_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scalingAdjustmentType") unless @scaling_adjustment_type.nil? @target_configuration = target_configuration.is_a?(Hash) ? ::AWSCDK::GameLift::CfnContainerFleet::TargetConfigurationProperty.new(**target_configuration.transform_keys(&:to_sym)) : target_configuration Jsii::Type.check_type(@target_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nYW1lbGlmdC5DZm5Db250YWluZXJGbGVldC5UYXJnZXRDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "targetConfiguration") unless @target_configuration.nil? @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") unless @threshold.nil? end |
Instance Attribute Details
#comparison_operator ⇒ String? (readonly)
Comparison operator to use when measuring a metric against the threshold value.
1399 1400 1401 |
# File 'game_lift/cfn_container_fleet.rb', line 1399 def comparison_operator @comparison_operator end |
#evaluation_periods ⇒ Numeric? (readonly)
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
1404 1405 1406 |
# File 'game_lift/cfn_container_fleet.rb', line 1404 def evaluation_periods @evaluation_periods end |
#metric_name ⇒ String (readonly)
Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment.
For detailed descriptions of fleet metrics, see Monitor Amazon GameLift Servers with Amazon CloudWatch .
- ActivatingGameSessions -- Game sessions in the process of being created.
- ActiveGameSessions -- Game sessions that are currently running.
- ActiveInstances -- Fleet instances that are currently running at least one game session.
- AvailableGameSessions -- Additional game sessions that fleet could host simultaneously, given current capacity.
- AvailablePlayerSessions -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.
- CurrentPlayerSessions -- Player slots in active game sessions that are being used by a player or are reserved for a player.
- IdleInstances -- Active instances that are currently hosting zero game sessions.
- PercentAvailableGameSessions -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.
- PercentIdleInstances -- Percentage of the total number of active instances that are hosting zero game sessions.
- QueueDepth -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
- WaitTime -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
1387 1388 1389 |
# File 'game_lift/cfn_container_fleet.rb', line 1387 def metric_name @metric_name end |
#name ⇒ String (readonly)
A descriptive label that is associated with a fleet's scaling policy.
Policy names do not need to be unique.
1394 1395 1396 |
# File 'game_lift/cfn_container_fleet.rb', line 1394 def name @name end |
#policy_type ⇒ String? (readonly)
The type of scaling policy to create.
For a target-based policy, set the parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration . For a rule-based policy set the following parameters: MetricName , ComparisonOperator , Threshold , EvaluationPeriods , ScalingAdjustmentType , and ScalingAdjustment .
1411 1412 1413 |
# File 'game_lift/cfn_container_fleet.rb', line 1411 def policy_type @policy_type end |
#scaling_adjustment ⇒ Numeric? (readonly)
Amount of adjustment to make, based on the scaling adjustment type.
1416 1417 1418 |
# File 'game_lift/cfn_container_fleet.rb', line 1416 def scaling_adjustment @scaling_adjustment end |
#scaling_adjustment_type ⇒ String? (readonly)
The type of adjustment to make to a fleet's instance count.
- ChangeInCapacity -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.
- ExactCapacity -- set the instance count to the scaling adjustment value.
- PercentChangeInCapacity -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down.
1425 1426 1427 |
# File 'game_lift/cfn_container_fleet.rb', line 1425 def scaling_adjustment_type @scaling_adjustment_type end |
#target_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
An object that contains settings for a target-based scaling policy.
1430 1431 1432 |
# File 'game_lift/cfn_container_fleet.rb', line 1430 def target_configuration @target_configuration end |
#threshold ⇒ Numeric? (readonly)
Metric value used to trigger a scaling event.
1435 1436 1437 |
# File 'game_lift/cfn_container_fleet.rb', line 1435 def threshold @threshold end |
Class Method Details
.jsii_properties ⇒ Object
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 |
# File 'game_lift/cfn_container_fleet.rb', line 1437 def self.jsii_properties { :metric_name => "metricName", :name => "name", :comparison_operator => "comparisonOperator", :evaluation_periods => "evaluationPeriods", :policy_type => "policyType", :scaling_adjustment => "scalingAdjustment", :scaling_adjustment_type => "scalingAdjustmentType", :target_configuration => "targetConfiguration", :threshold => "threshold", } end |
Instance Method Details
#to_jsii ⇒ Object
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 |
# File 'game_lift/cfn_container_fleet.rb', line 1451 def to_jsii result = {} result.merge!({ "metricName" => @metric_name, "name" => @name, "comparisonOperator" => @comparison_operator, "evaluationPeriods" => @evaluation_periods, "policyType" => @policy_type, "scalingAdjustment" => @scaling_adjustment, "scalingAdjustmentType" => @scaling_adjustment_type, "targetConfiguration" => @target_configuration, "threshold" => @threshold, }) result.compact end |