Class: JobWorkflow::AutoScaling::Configuration
- Inherits:
-
Object
- Object
- JobWorkflow::AutoScaling::Configuration
- Defined in:
- lib/job_workflow/auto_scaling/configuration.rb,
sig/generated/job_workflow/auto_scaling/configuration.rbs
Instance Attribute Summary collapse
- #max_count ⇒ Integer
- #max_latency ⇒ Integer
- #min_count ⇒ Integer
- #queue_name ⇒ String
- #step_count ⇒ Integer
Instance Method Summary collapse
-
#assert_positive_number!(number) ⇒ void
: (Integer) -> void.
-
#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 ⇒ Integer
: () -> 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 ⇒ Integer
8 9 10 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 8 def max_count @max_count end |
#max_latency ⇒ Integer
10 11 12 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 10 def max_latency @max_latency end |
#min_count ⇒ Integer
7 8 9 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 7 def min_count @min_count end |
#queue_name ⇒ String
6 7 8 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 6 def queue_name @queue_name end |
#step_count ⇒ Integer
9 10 11 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 9 def step_count @step_count end |
Instance Method Details
#assert_positive_number!(number) ⇒ void
This method returns an undefined value.
: (Integer) -> void
80 81 82 |
# File 'lib/job_workflow/auto_scaling/configuration.rb', line 80 def assert_positive_number!(number) raise ArgumentError unless number.positive? end |
#latency_per_step_count ⇒ Integer
: () -> 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 |