Class: LoadBalancedRestClient::Algorithms::ExponentialDowntime

Inherits:
Object
  • Object
show all
Defined in:
lib/algorithms/exponential_downtime.rb

Instance Method Summary collapse

Constructor Details

#initialize(exp = 2, factor = 60) ⇒ ExponentialDowntime

Returns a new instance of ExponentialDowntime.



4
5
6
7
# File 'lib/algorithms/exponential_downtime.rb', line 4

def initialize(exp = 2, factor = 60)
  @e = exp
  @f = factor
end

Instance Method Details

#call(x) ⇒ Object



9
10
11
# File 'lib/algorithms/exponential_downtime.rb', line 9

def call(x)
  (x ** @e) * @f
end