Class: Fluent::JmxInput
- Inherits:
-
Input
- Object
- Input
- Fluent::JmxInput
- Defined in:
- lib/fluent/plugin/in_jmx.rb
Defined Under Namespace
Classes: TimerWatcher
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ JmxInput
constructor
A new instance of JmxInput.
- #run ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ JmxInput
Returns a new instance of JmxInput.
17 18 19 20 21 22 |
# File 'lib/fluent/plugin/in_jmx.rb', line 17 def initialize super require 'net/http' require 'uri' require 'json' end |
Instance Method Details
#configure(conf) ⇒ Object
24 25 26 |
# File 'lib/fluent/plugin/in_jmx.rb', line 24 def configure(conf) super end |
#run ⇒ Object
41 42 43 44 45 46 |
# File 'lib/fluent/plugin/in_jmx.rb', line 41 def run @loop.run rescue => e @log.error 'unexpected error', error: e.to_s @log.error_backtrace end |
#shutdown ⇒ Object
35 36 37 38 39 |
# File 'lib/fluent/plugin/in_jmx.rb', line 35 def shutdown @tw.detach @loop.stop @thread.join end |
#start ⇒ Object
28 29 30 31 32 33 |
# File 'lib/fluent/plugin/in_jmx.rb', line 28 def start @loop = Coolio::Loop.new @tw = TimerWatcher.new(interval, true, log, &method(:execute)) @tw.attach(@loop) @thread = Thread.new(&method(:run)) end |