Permalink
Browse files

fix to send PackedForward object for memory usage of fluentd

  • Loading branch information...
1 parent 7460625 commit 0802aa24a474dbbf5e175d077c49e4d1df567df0 @tagomoris tagomoris committed Mar 21, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Fluent/AgentLite.pm
View
@@ -193,12 +193,13 @@ sub drain {
return (\@buffered_lines, $continuous_line, $readlines);
}
-# MessagePack 'Forward' object
+# MessagePack 'PackedForward' object
# see lib/fluent/plugin/in_forward.rb in fluentd
sub pack {
my ($self,$packer,$fieldname,$lines) = @_;
my $t = time;
- return $packer->pack([$self->{tag}, [ map { [$t, {$fieldname => $_}] } @$lines ]]);
+ my $event_stream = join('', map { $packer->pack([$t, {$fieldname => $_}]) } @$lines);
+ return $packer->pack([$self->{tag}, $event_stream]);
}
# MessagePack 'Message' object

0 comments on commit 0802aa2

Please sign in to comment.