Class: AWSCDK::GameLift::CfnFleet::ScalingPolicyProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::GameLift::CfnFleet::ScalingPolicyProperty
- Defined in:
- game_lift/cfn_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.
-
#location ⇒ String?
readonly
The fleet location.
-
#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.
-
#status ⇒ String?
readonly
Current status of the scaling policy.
-
#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.
-
#update_status ⇒ String?
readonly
The current status of the fleet's scaling policies in a requested fleet location.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, location: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, status: nil, target_configuration: nil, threshold: nil, update_status: nil) ⇒ ScalingPolicyProperty
constructor
A new instance of ScalingPolicyProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, location: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, status: nil, target_configuration: nil, threshold: nil, update_status: nil) ⇒ ScalingPolicyProperty
Returns a new instance of ScalingPolicyProperty.
1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 |
# File 'game_lift/cfn_fleet.rb', line 1428 def initialize(metric_name:, name:, comparison_operator: nil, evaluation_periods: nil, location: nil, policy_type: nil, scaling_adjustment: nil, scaling_adjustment_type: nil, status: nil, target_configuration: nil, threshold: nil, update_status: 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? @location = location Jsii::Type.check_type(@location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "location") unless @location.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? @status = status Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "status") unless @status.nil? @target_configuration = target_configuration.is_a?(Hash) ? ::AWSCDK::GameLift::CfnFleet::TargetConfigurationProperty.new(**target_configuration.transform_keys(&:to_sym)) : target_configuration Jsii::Type.check_type(@target_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nYW1lbGlmdC5DZm5GbGVldC5UYXJnZXRDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "targetConfiguration") unless @target_configuration.nil? @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") unless @threshold.nil? @update_status = update_status Jsii::Type.check_type(@update_status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "updateStatus") unless @update_status.nil? end |
Instance Attribute Details
#comparison_operator ⇒ String? (readonly)
Comparison operator to use when measuring a metric against the threshold value.
1485 1486 1487 |
# File 'game_lift/cfn_fleet.rb', line 1485 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.
1490 1491 1492 |
# File 'game_lift/cfn_fleet.rb', line 1490 def evaluation_periods @evaluation_periods end |
#location ⇒ String? (readonly)
The fleet location.
1495 1496 1497 |
# File 'game_lift/cfn_fleet.rb', line 1495 def location @location 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.
1473 1474 1475 |
# File 'game_lift/cfn_fleet.rb', line 1473 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.
1480 1481 1482 |
# File 'game_lift/cfn_fleet.rb', line 1480 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 .
1502 1503 1504 |
# File 'game_lift/cfn_fleet.rb', line 1502 def policy_type @policy_type end |
#scaling_adjustment ⇒ Numeric? (readonly)
Amount of adjustment to make, based on the scaling adjustment type.
1507 1508 1509 |
# File 'game_lift/cfn_fleet.rb', line 1507 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.
1516 1517 1518 |
# File 'game_lift/cfn_fleet.rb', line 1516 def scaling_adjustment_type @scaling_adjustment_type end |
#status ⇒ String? (readonly)
Current status of the scaling policy.
The scaling policy can be in force only when in an ACTIVE status. Scaling policies can be suspended for individual fleets. If the policy is suspended for a fleet, the policy status does not change.
- ACTIVE -- The scaling policy can be used for auto-scaling a fleet.
- UPDATE_REQUESTED -- A request to update the scaling policy has been received.
- UPDATING -- A change is being made to the scaling policy.
- DELETE_REQUESTED -- A request to delete the scaling policy has been received.
- DELETING -- The scaling policy is being deleted.
- DELETED -- The scaling policy has been deleted.
- ERROR -- An error occurred in creating the policy. It should be removed and recreated.
1531 1532 1533 |
# File 'game_lift/cfn_fleet.rb', line 1531 def status @status end |
#target_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
An object that contains settings for a target-based scaling policy.
1536 1537 1538 |
# File 'game_lift/cfn_fleet.rb', line 1536 def target_configuration @target_configuration end |
#threshold ⇒ Numeric? (readonly)
Metric value used to trigger a scaling event.
1541 1542 1543 |
# File 'game_lift/cfn_fleet.rb', line 1541 def threshold @threshold end |
#update_status ⇒ String? (readonly)
The current status of the fleet's scaling policies in a requested fleet location.
The status PENDING_UPDATE indicates that an update was requested for the fleet but has not yet been completed for the location.
1548 1549 1550 |
# File 'game_lift/cfn_fleet.rb', line 1548 def update_status @update_status end |
Class Method Details
.jsii_properties ⇒ Object
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File 'game_lift/cfn_fleet.rb', line 1550 def self.jsii_properties { :metric_name => "metricName", :name => "name", :comparison_operator => "comparisonOperator", :evaluation_periods => "evaluationPeriods", :location => "location", :policy_type => "policyType", :scaling_adjustment => "scalingAdjustment", :scaling_adjustment_type => "scalingAdjustmentType", :status => "status", :target_configuration => "targetConfiguration", :threshold => "threshold", :update_status => "updateStatus", } end |
Instance Method Details
#to_jsii ⇒ Object
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 |
# File 'game_lift/cfn_fleet.rb', line 1567 def to_jsii result = {} result.merge!({ "metricName" => @metric_name, "name" => @name, "comparisonOperator" => @comparison_operator, "evaluationPeriods" => @evaluation_periods, "location" => @location, "policyType" => @policy_type, "scalingAdjustment" => @scaling_adjustment, "scalingAdjustmentType" => @scaling_adjustment_type, "status" => @status, "targetConfiguration" => @target_configuration, "threshold" => @threshold, "updateStatus" => @update_status, }) result.compact end |