Module: SF6::Breaker

Defined in:
lib/sf6.rb

Class Method Summary collapse

Class Method Details

.check(attr, value, bucket, &blk) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/sf6.rb', line 46

def self.check(attr, value, bucket, &blk)
  timestamp = SF6.stamp(data, attr, bucket)
  SF6.test(data, attr, value) do
    begin
      yield
    rescue => e
      SF6.increment(data, attr, timestamp)
      raise
    end
  end
end

.dataObject



42
43
44
# File 'lib/sf6.rb', line 42

def self.data
  @data ||= {counts: Hash.new(0), timestamps: Hash.new(0)}
end