Module: Hcheck

Defined in:
lib/hcheck.rb,
lib/hcheck/errors.rb,
lib/hcheck/version.rb,
lib/hcheck/application.rb,
lib/hcheck/checks/ping.rb,
lib/hcheck/checks/mysql.rb,
lib/hcheck/checks/redis.rb,
lib/hcheck/configuration.rb,
lib/hcheck/checks/mongodb.rb,
lib/hcheck/checks/rabbitmq.rb,
lib/hcheck/checks/memcached.rb,
lib/hcheck/checks/postgresql.rb,
lib/hcheck/configuration/service.rb,
lib/hcheck/application/helpers/responders.rb

Overview

Main Hcheck module

Defined Under Namespace

Modules: ApplicationHelpers, Checks, Errors Classes: Application, Configuration, SinatraBase, Status

Constant Summary collapse

LOG_FILE_PATH =
'log/hcheck.log'
VERSION =
'0.1.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



16
17
18
# File 'lib/hcheck.rb', line 16

def configuration
  @configuration
end

.loggingObject

Returns the value of attribute logging.



16
17
18
# File 'lib/hcheck.rb', line 16

def logging
  @logging
end

Class Method Details

.configure(config = {}) ⇒ Object



32
33
34
# File 'lib/hcheck.rb', line 32

def configure(config = {})
  self.configuration ||= Configuration.new(config)
end

.loggerObject



36
37
38
# File 'lib/hcheck.rb', line 36

def logger
  self.logging ||= set_logger
end

.statusObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/hcheck.rb', line 20

def status
  if configuration
    configuration.services.map(&:check)
  else
    [{
      name: 'Hcheck',
      desc: 'Hcheck',
      status: 'Hcheck configuration not found'
    }]
  end
end