Module: Fluent::PluginMixin::ChunkJsonStreamer

Defined in:
lib/fluent/plugin_mixin/chunk_json_streamer.rb

Instance Method Summary collapse

Instance Method Details

#recordsObject

Iterate over records in chunk

Since:

  • 0.1.0



7
8
9
10
11
12
13
# File 'lib/fluent/plugin_mixin/chunk_json_streamer.rb', line 7

def records
  records = []
  each do |time, record|
    records << record
  end
  records
end

#to_json_streamObject

Serialize the chunk to a Json object

Since:

  • 0.1.0



18
19
20
# File 'lib/fluent/plugin_mixin/chunk_json_streamer.rb', line 18

def to_json_stream
  json_serializer_proc.call(records)
end