Class: Amigo::Autoscaler::Checkers::Fake
- Inherits:
-
Amigo::Autoscaler::Checker
- Object
- Amigo::Autoscaler::Checker
- Amigo::Autoscaler::Checkers::Fake
- Defined in:
- lib/amigo/autoscaler/checkers/fake.rb
Instance Method Summary collapse
- #get_latencies ⇒ Object
- #get_pool_usage ⇒ Object
-
#initialize(latencies: {}, pool_usage: nil) ⇒ Fake
constructor
A new instance of Fake.
Constructor Details
#initialize(latencies: {}, pool_usage: nil) ⇒ Fake
Returns a new instance of Fake.
9 10 11 12 13 |
# File 'lib/amigo/autoscaler/checkers/fake.rb', line 9 def initialize(latencies: {}, pool_usage: nil) @latencies = latencies @pool_usage = pool_usage super() end |
Instance Method Details
#get_latencies ⇒ Object
15 16 17 18 19 |
# File 'lib/amigo/autoscaler/checkers/fake.rb', line 15 def get_latencies return @latencies.call if @latencies.respond_to?(:call) return @latencies.shift if @latencies.is_a?(Array) return @latencies end |
#get_pool_usage ⇒ Object
21 22 23 24 25 |
# File 'lib/amigo/autoscaler/checkers/fake.rb', line 21 def get_pool_usage return @pool_usage.call if @pool_usage.respond_to?(:call) return @pool_usage.shift if @pool_usage.is_a?(Array) return @pool_usage end |