Module: Healthchecker

Defined in:
lib/healthchecker.rb,
lib/healthchecker/check.rb,
lib/healthchecker/engine.rb,
lib/healthchecker/version.rb,
lib/healthchecker/configuration.rb,
app/helpers/healthchecker/application_helper.rb,
app/controllers/healthchecker/health_controller.rb,
app/controllers/healthchecker/metrics_controller.rb,
app/controllers/healthchecker/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, Checks Classes: ApplicationController, Check, Configuration, ConfigurationError, Engine, HealthController, MetricsController

Constant Summary collapse

APPLICATION_STARTED_AT =
Time.now
VERSION =
"1.1.5"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



31
32
33
# File 'lib/healthchecker.rb', line 31

def self.configuration
  @configuration ||= Configuration.new
end

Class Method Details

.add_check(name_or_class, options = {}) ⇒ Object



23
24
25
# File 'lib/healthchecker.rb', line 23

def self.add_check(name_or_class, options={})
  self.checks << lookup_class(name_or_class).new(options.merge(check: name_or_class))
end

.configure {|configuration| ... } ⇒ Object

Yields:



39
40
41
# File 'lib/healthchecker.rb', line 39

def self.configure
  yield(configuration)
end

.perform_checksObject



27
28
29
# File 'lib/healthchecker.rb', line 27

def self.perform_checks
  self.checks.map(&:perform_check).compact
end

.resetObject



35
36
37
# File 'lib/healthchecker.rb', line 35

def self.reset
  @configuration = Configuration.new
end