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



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

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



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

def shutdown
    @thread.kill
end

#startObject



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

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