class Fluent::StatsitePlugin::StatsiteAggregateParser

Constants

FLUSH_WAIT

TODO: should be configurable?

Public Class Methods

new(on_message, coolio_loop) click to toggle source
# File lib/fluent/plugin/statsite/parser.rb, line 53
def initialize(on_message, coolio_loop)
  @on_message = on_message
  @loop = coolio_loop
  @buf = {}
end

Public Instance Methods

call(io) click to toggle source
# File lib/fluent/plugin/statsite/parser.rb, line 59
def call(io)
  io.each_line(&method(:each_line))
end
each_line(line) click to toggle source
# File lib/fluent/plugin/statsite/parser.rb, line 63
def each_line(line)
  record = parse_line(line)

  raise "out_statsite: failed to parse a line. '#{line}'" if record.nil?

  timer = TimerWatcher(FLUSH_WAIT, $log, method(&:flush))
end
flush() click to toggle source
# File lib/fluent/plugin/statsite/parser.rb, line 71
def flush
  @on_message.call(t.to_i, record)
end