Module: Simple::Metrics::Healthchecks
- Includes:
- Simple::Metrics
- Defined in:
- lib/simple/metrics/healthcheck.rb
Constant Summary
Constant Summary
Constants included from Simple::Metrics
DEFAULT_DURATION_UNIT, DEFAULT_RATE_UNIT, DEFAULT_TIMING_UNIT, VERSION
Instance Method Summary (collapse)
-
- (MetricName) new_healthcheck(name, &blk)
Create a new healthcheck.
-
- (Object) run_all_healthchecks
Run all of the healthchecks that have been defined.
-
- (Object) run_healthcheck_loop
Run the healthcheck loop This starts a new thread that runs all of the defined healthcheck loops.
Methods included from Simple::Metrics
#metrics_registry, #new_metric_name, #sanitize_classname
Methods included from Timer
Instance Method Details
- (MetricName) new_healthcheck(name, &blk)
Create a new healthcheck
12 13 14 15 16 |
# File 'lib/simple/metrics/healthcheck.rb', line 12 def new_healthcheck(name, &blk) healthcheck = Check.new(name, &blk) Java::ComYammerMetrics::HealthChecks.register(healthcheck) run_healthcheck_loop end |
- (Object) run_all_healthchecks
Run all of the healthchecks that have been defined
32 33 34 |
# File 'lib/simple/metrics/healthcheck.rb', line 32 def run_all_healthchecks Java::ComYammerMetrics::HealthChecks.runHealthChecks end |
- (Object) run_healthcheck_loop
Run the healthcheck loop This starts a new thread that runs all of the defined healthcheck loops.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/simple/metrics/healthcheck.rb', line 20 def run_healthcheck_loop return if @running_healthcheck_loop Thread.new do loop do run_all_healthchecks sleep 5 end end @running_healthcheck_loop = true end |