diff --git a/lib/fluent/compat/output.rb b/lib/fluent/compat/output.rb index 24cbf386cd..d169a6818c 100644 --- a/lib/fluent/compat/output.rb +++ b/lib/fluent/compat/output.rb @@ -361,11 +361,12 @@ def handle_stream_simple(tag, es, enqueue: false) end meta = metadata(nil, nil, nil) + size = es.size data = es.map{|time,record| format(tag, time, record) } write_guard do @buffer.write({meta => data}, enqueue: enqueue) end - @counters_monitor.synchronize{ @emit_records += es_size } + @counters_monitor.synchronize{ @emit_records += size } [meta] end