Class: Fluent::DockerMetricsInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



108
109
110
111
112
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 108

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

Instance Method Details

#on_timerObject



113
114
115
116
117
118
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 113

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