Class: Fluent::StatusInput
- Inherits:
-
Input
- Object
- Input
- Fluent::StatusInput
show all
- Defined in:
- lib/fluent/plugin/in_status.rb
Defined Under Namespace
Classes: TimerWatcher
Constant Summary
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes inherited from Input
#router
#log
Instance Method Summary
collapse
included
Methods included from PluginId
#plugin_id
#config, included, lookup_type, register_type
Constructor Details
Returns a new instance of StatusInput.
21
22
23
|
# File 'lib/fluent/plugin/in_status.rb', line 21
def initialize
super
end
|
Instance Method Details
44
45
46
47
|
# File 'lib/fluent/plugin/in_status.rb', line 44
def configure(conf)
super
$log.warn "in_status plugin will be removed v0.14 or later. Use in_monitor_agent instead"
end
|
#on_timer ⇒ Object
69
70
71
72
73
74
|
# File 'lib/fluent/plugin/in_status.rb', line 69
def on_timer
now = Engine.now
Status.each {|record|
router.emit(@tag, now, record)
}
end
|
#run ⇒ Object
62
63
64
65
66
67
|
# File 'lib/fluent/plugin/in_status.rb', line 62
def run
@loop.run
rescue
log.error "unexpected error", :error=>$!.to_s
log.error_backtrace
end
|
#shutdown ⇒ Object
56
57
58
59
60
|
# File 'lib/fluent/plugin/in_status.rb', line 56
def shutdown
@loop.watchers.each {|w| w.detach }
@loop.stop
@thread.join
end
|
#start ⇒ Object
49
50
51
52
53
54
|
# File 'lib/fluent/plugin/in_status.rb', line 49
def start
@loop = Coolio::Loop.new
@timer = TimerWatcher.new(@emit_interval, true, log, &method(:on_timer))
@loop.attach(@timer)
@thread = Thread.new(&method(:run))
end
|