Class: Fluent::FnordMetricOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/fluent/plugin/out_fnordmetric.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFnordMetricOutput

Returns a new instance of FnordMetricOutput.



12
13
14
15
# File 'lib/fluent/plugin/out_fnordmetric.rb', line 12

def initialize
  require 'fnordmetric'
  super
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



5
6
7
# File 'lib/fluent/plugin/out_fnordmetric.rb', line 5

def api
  @api
end

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  @api = FnordMetric::API.new(conf)
  super
end

#emit(tag, es, chain) ⇒ Object



31
32
33
34
35
36
# File 'lib/fluent/plugin/out_fnordmetric.rb', line 31

def emit(tag, es, chain)
  es.each { |time,record|
    @api.event(:_type => tag, :info => record)
  }
  chain.next
end

#shutdownObject



26
27
28
29
# File 'lib/fluent/plugin/out_fnordmetric.rb', line 26

def shutdown
  @api.disconnect
  super
end

#startObject



22
23
24
# File 'lib/fluent/plugin/out_fnordmetric.rb', line 22

def start
  super
end