module ServiceJynx

Constants

VERSION

Public Class Methods

alive?(name) click to toggle source
# File lib/service_jynx.rb, line 19
def self.alive?(name)
  @counters[name].alive? == true
end
counters() click to toggle source
# File lib/service_jynx.rb, line 7
def self.counters
  @counters
end
down!(name, reason) click to toggle source
# File lib/service_jynx.rb, line 23
def self.down!(name, reason)
  @counters[name].down!(reason)
end
failure!(name) click to toggle source
# File lib/service_jynx.rb, line 31
def self.failure!(name)
  jynx = @counters[name]
  now = Time.now.to_i
  jynx.errors << now
  jynx.clean_aged(now)
  if jynx.errors.count > jynx.max_errors
    down!(name, "Max error count (#{jynx.max_errors}) reached at #{Time.now}.")
    :WENT_DOWN
  else
    :FAIL_MARKED
  end
end
flush!() click to toggle source
# File lib/service_jynx.rb, line 15
def self.flush!
  @counters = {}
end
register!(name, options = {}) click to toggle source
# File lib/service_jynx.rb, line 11
def self.register!(name, options = {})
  @counters[name] = Jynx.new(name, options)
end
up!(name) click to toggle source
# File lib/service_jynx.rb, line 27
def self.up!(name)
  @counters[name].up!
end