Class: Fluent::JmxInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



74
75
76
77
78
# File 'lib/fluent/plugin/in_jmx.rb', line 74

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

Instance Method Details

#on_timerObject



80
81
82
83
84
85
# File 'lib/fluent/plugin/in_jmx.rb', line 80

def on_timer
  @callback.call
rescue => e
  @log.error e.to_s
  @log.error_backtrace
end