Class: Fluent::StatsitePlugin::StatsiteParser
- Inherits:
-
Object
- Object
- Fluent::StatsitePlugin::StatsiteParser
show all
- Includes:
- Parser
- Defined in:
- lib/fluent/plugin/statsite/parser.rb
Instance Method Summary
collapse
Methods included from Parser
#build_record, #parse_line
Constructor Details
33
34
35
|
# File 'lib/fluent/plugin/statsite/parser.rb', line 33
def initialize(on_message)
@on_message = on_message
end
|
Instance Method Details
#call(io) ⇒ Object
37
38
39
|
# File 'lib/fluent/plugin/statsite/parser.rb', line 37
def call(io)
io.each_line(&method(:each_line))
end
|
#each_line(line) ⇒ Object
41
42
43
44
45
46
|
# File 'lib/fluent/plugin/statsite/parser.rb', line 41
def each_line(line)
time, record = parse_line(line)
raise "out_statsite: failed to parse a line. '#{line}'" if record.nil?
@on_message.call(time, record)
end
|