Class: JobWorkflow::AutoScaling::Configuration
- Inherits:
-
Object
- Object
- JobWorkflow::AutoScaling::Configuration
- Defined in:
- lib/job_workflow/auto_scaling/configuration.rb
Instance Attribute Summary collapse
-
#max_count ⇒ Object
: Integer.
-
#max_latency ⇒ Object
: Integer.
-
#min_count ⇒ Object
: Integer.
-
#queue_name ⇒ Object
: String.
-
#step_count ⇒ Object
: Integer.
Instance Method Summary collapse
-
#initialize(queue_name: "default", min_count: 1, max_count: 1, step_count: 1, max_latency: 3_600) ⇒ Configuration
constructor
: ( ?queue_name: String, ?min_count: Integer, ?max_count: Integer, ?step_count: Integer, ?max_latency: Integer ) -> void.
-
#latency_per_step_count ⇒ Object
: () -> Integer.
Constructor Details
#initialize(queue_name: "default", min_count: 1, max_count: 1, step_count: 1, max_latency: 3_600) ⇒ Configuration
: (
?queue_name: String,
?min_count: Integer,
?max_count: Integer,
?step_count: Integer,
?max_latency: Integer
) -> void
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 20 def initialize( queue_name: "default", min_count: 1, max_count: 1, step_count: 1, max_latency: 3_600 ) self.queue_name = queue_name self.min_count = min_count self.max_count = max_count self.step_count = step_count self.max_latency = max_latency end |
Instance Attribute Details
#max_count ⇒ Object
: Integer
8 9 10 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 8 def max_count @max_count end |
#max_latency ⇒ Object
: Integer
10 11 12 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 10 def max_latency @max_latency end |
#min_count ⇒ Object
: Integer
7 8 9 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 7 def min_count @min_count end |
#queue_name ⇒ Object
: String
6 7 8 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 6 def queue_name @queue_name end |
#step_count ⇒ Object
: Integer
9 10 11 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 9 def step_count @step_count end |
Instance Method Details
#latency_per_step_count ⇒ Object
: () -> Integer
35 36 37 38 39 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 35 def latency_per_step_count (max_latency / ((1 + max_count - min_count).to_f / step_count).ceil).tap do |value| value.positive? || (raise Error, "latency per count isn't positive!") end end |