Class: Fluent::JstatInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



17
18
19
20
# File 'lib/fluent/plugin/in_jstat.rb', line 17

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

Instance Method Details

#on_timerObject



22
23
24
25
26
27
28
# File 'lib/fluent/plugin/in_jstat.rb', line 22

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