Class: Fluent::Agent::NoMatchMatch

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

Instance Method Summary collapse

Constructor Details

#initialize(log) ⇒ NoMatchMatch

Returns a new instance of NoMatchMatch.



165
166
167
168
# File 'lib/fluent/agent.rb', line 165

def initialize(log)
  @log = log
  @count = 0
end

Instance Method Details

#emit_events(tag, es) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/fluent/agent.rb', line 170

def emit_events(tag, es)
  # TODO use time instead of num of records
  c = (@count += 1)
  if c < 512
    if Math.log(c) / Math.log(2) % 1.0 == 0
      @log.warn "no patterns matched", tag: tag
      return
    end
  else
    if c % 512 == 0
      @log.warn "no patterns matched", tag: tag
      return
    end
  end
  @log.on_trace { @log.trace "no patterns matched", tag: tag }
end

#shutdownObject



190
191
# File 'lib/fluent/agent.rb', line 190

def shutdown
end

#startObject



187
188
# File 'lib/fluent/agent.rb', line 187

def start
end