Class: Fluent::PrometheusTailMonitorInput::TimerWatcher
- Inherits:
-
Coolio::TimerWatcher
- Object
- Coolio::TimerWatcher
- Fluent::PrometheusTailMonitorInput::TimerWatcher
- Defined in:
- lib/fluent/plugin/in_prometheus_tail_monitor.rb
Instance Method Summary collapse
-
#initialize(interval, repeat, log, &callback) ⇒ TimerWatcher
constructor
A new instance of TimerWatcher.
- #on_timer ⇒ Object
Constructor Details
#initialize(interval, repeat, log, &callback) ⇒ TimerWatcher
Returns a new instance of TimerWatcher.
49 50 51 52 53 |
# File 'lib/fluent/plugin/in_prometheus_tail_monitor.rb', line 49 def initialize(interval, repeat, log, &callback) @callback = callback @log = log super(interval, repeat) end |
Instance Method Details
#on_timer ⇒ Object
55 56 57 58 59 60 |
# File 'lib/fluent/plugin/in_prometheus_tail_monitor.rb', line 55 def on_timer @callback.call rescue @log.error $!.to_s @log.error_backtrace end |