Class: Amigo::Autoscaler::Checkers::Fake

Inherits:
Amigo::Autoscaler::Checker show all
Defined in:
lib/amigo/autoscaler/checkers/fake.rb

Instance Method Summary collapse

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_latenciesObject



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_usageObject



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