Class: Fluent::TopInputParser

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

Constant Summary collapse

STATE_HEADER =

state

1
STATE_PROCESS =
2
@@PS_INFO =
Struct.new(:pid, :user, :res, :cpu, :mem, :cmd, :args)

Instance Method Summary collapse

Constructor Details

#initializeTopInputParser

Returns a new instance of TopInputParser.



9
10
11
# File 'lib/fluent/plugin/in_top_parser.rb', line 9

def initialize()
  reset_state
end

Instance Method Details

#parse(line) ⇒ Object



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

def parse(line)
  case @state
  when STATE_HEADER then
    return parse_header line
  else
    return parse_process line
  end
end