Class: Fluent::GCStatInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



33
34
35
36
37
# File 'lib/fluent/plugin/in_gc_stat.rb', line 33

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

Instance Method Details

#on_timerObject



39
40
41
42
43
44
45
# File 'lib/fluent/plugin/in_gc_stat.rb', line 39

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