Class: Hako::Schedulers::EcsAutoscaling::Policy
- Inherits:
-
Object
- Object
- Hako::Schedulers::EcsAutoscaling::Policy
- Defined in:
- lib/hako/schedulers/ecs_autoscaling.rb
Instance Attribute Summary collapse
-
#adjustment_type ⇒ Object
readonly
Returns the value of attribute adjustment_type.
-
#alarms ⇒ Object
readonly
Returns the value of attribute alarms.
-
#cooldown ⇒ Object
readonly
Returns the value of attribute cooldown.
-
#metric_aggregation_type ⇒ Object
readonly
Returns the value of attribute metric_aggregation_type.
-
#metric_interval_lower_bound ⇒ Object
readonly
Returns the value of attribute metric_interval_lower_bound.
-
#metric_interval_upper_bound ⇒ Object
readonly
Returns the value of attribute metric_interval_upper_bound.
-
#scaling_adjustment ⇒ Object
readonly
Returns the value of attribute scaling_adjustment.
Instance Method Summary collapse
-
#initialize(options) ⇒ Policy
constructor
A new instance of Policy.
- #name ⇒ String
- #required_option(options, key) ⇒ Object private
Constructor Details
#initialize(options) ⇒ Policy
Returns a new instance of Policy.
143 144 145 146 147 148 149 150 151 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 143 def initialize() @alarms = required_option(, 'alarms') @cooldown = required_option(, 'cooldown') @adjustment_type = required_option(, 'adjustment_type') @scaling_adjustment = required_option(, 'scaling_adjustment') @metric_interval_lower_bound = .fetch('metric_interval_lower_bound', nil) @metric_interval_upper_bound = .fetch('metric_interval_upper_bound', nil) @metric_aggregation_type = required_option(, 'metric_aggregation_type') end |
Instance Attribute Details
#adjustment_type ⇒ Object (readonly)
Returns the value of attribute adjustment_type.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def adjustment_type @adjustment_type end |
#alarms ⇒ Object (readonly)
Returns the value of attribute alarms.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def alarms @alarms end |
#cooldown ⇒ Object (readonly)
Returns the value of attribute cooldown.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def cooldown @cooldown end |
#metric_aggregation_type ⇒ Object (readonly)
Returns the value of attribute metric_aggregation_type.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def metric_aggregation_type @metric_aggregation_type end |
#metric_interval_lower_bound ⇒ Object (readonly)
Returns the value of attribute metric_interval_lower_bound.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def metric_interval_lower_bound @metric_interval_lower_bound end |
#metric_interval_upper_bound ⇒ Object (readonly)
Returns the value of attribute metric_interval_upper_bound.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def metric_interval_upper_bound @metric_interval_upper_bound end |
#scaling_adjustment ⇒ Object (readonly)
Returns the value of attribute scaling_adjustment.
140 141 142 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 140 def scaling_adjustment @scaling_adjustment end |
Instance Method Details
#name ⇒ String
154 155 156 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 154 def name alarms.join('-and-') end |
#required_option(options, key) ⇒ Object (private)
163 164 165 |
# File 'lib/hako/schedulers/ecs_autoscaling.rb', line 163 def required_option(, key) .fetch(key) { raise Error.new("scheduler.autoscaling.policies.#{key} must be set") } end |