Class: Fluent::InHaproxyStats

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_haproxy_stats.rb

Instance Method Summary collapse

Constructor Details

#initializeInHaproxyStats

Returns a new instance of InHaproxyStats.



19
20
21
22
23
# File 'lib/fluent/plugin/in_haproxy_stats.rb', line 19

def initialize
  super
  #
  require "haproxy"
end

Instance Method Details

#configure(conf) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/fluent/plugin/in_haproxy_stats.rb', line 35

def configure(conf)
  super
  #
  unless File.exist?(@stats_file) or File.readable?(@stats_file)
    raise Fluent::ConfigError, 'HAProxy stats file does not exists or does not readable.' 
  end
end

#shutdownObject



30
31
32
33
# File 'lib/fluent/plugin/in_haproxy_stats.rb', line 30

def shutdown
  @finished = true
  @thread.join
end

#startObject



25
26
27
28
# File 'lib/fluent/plugin/in_haproxy_stats.rb', line 25

def start
  @finished = false
  @thread = Thread.new(&method(:run))
end