Class: SadfInput

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

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/fluent/plugin/in_sadf.rb', line 10

def configure(conf)
    super
    @interval_m = @sar_option.split.size.zero? ? @interval * 60 : @interval * 60 - 1
    begin
       `sar -V`
    rescue
       raise Fluent::ConfigError, "sar(sysstat) is not installed."
    end
end

#shutdownObject



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

def shutdown
    @thread.kill
end

#startObject



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

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