Class: Fluent::PrometheusMonitorInput::TimerWatcher

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/fluent/plugin/in_prometheus_monitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(interval, repeat, log, &callback) ⇒ TimerWatcher

Returns a new instance of TimerWatcher.



52
53
54
55
56
# File 'lib/fluent/plugin/in_prometheus_monitor.rb', line 52

def initialize(interval, repeat, log, &callback)
  @callback = callback
  @log = log
  super(interval, repeat)
end

Instance Method Details

#on_timerObject



58
59
60
61
62
63
# File 'lib/fluent/plugin/in_prometheus_monitor.rb', line 58

def on_timer
  @callback.call
rescue
  @log.error $!.to_s
  @log.error_backtrace
end