Module: HttpHealthCheck::Probe

Included in:
HttpHealthCheck::Probes::DelayedJob, HttpHealthCheck::Probes::RubyKafka, HttpHealthCheck::Probes::Sidekiq
Defined in:
lib/http_health_check/probe.rb,
lib/http_health_check/probe/result.rb

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



7
8
9
# File 'lib/http_health_check/probe.rb', line 7

def call(env)
  with_error_handler { probe(env) }
end

#metaObject



11
12
13
# File 'lib/http_health_check/probe.rb', line 11

def meta
  {}
end

#probe_error(extra_meta = {}) ⇒ Object



19
20
21
# File 'lib/http_health_check/probe.rb', line 19

def probe_error(extra_meta = {})
  Result.error(meta.merge(extra_meta))
end

#probe_ok(extra_meta = {}) ⇒ Object



15
16
17
# File 'lib/http_health_check/probe.rb', line 15

def probe_ok(extra_meta = {})
  Result.ok(meta.merge(extra_meta))
end

#with_error_handlerObject



23
24
25
26
27
# File 'lib/http_health_check/probe.rb', line 23

def with_error_handler
  yield
rescue StandardError => e
  probe_error(error_class: e.class.name, error_message: e.message)
end