Class: CB2::Percentage

Inherits:
RollingWindow show all
Defined in:
lib/cb2/strategies/percentage.rb

Instance Attribute Summary

Attributes inherited from RollingWindow

#duration, #redis, #reenable_after, #service, #threshold

Instance Method Summary collapse

Methods inherited from RollingWindow

#error, #half_open?, #initialize, #key, #last_open, #open?, #reset!, #success, #trip!

Constructor Details

This class inherits a constructor from CB2::RollingWindow

Instance Method Details

#countObject

keep a rolling window of all calls too



3
4
5
# File 'lib/cb2/strategies/percentage.rb', line 3

def count
  @current_count = increment_rolling_window(key("count"))
end