Skip to content

Commit

Permalink
buffer: refactoring code
Browse files Browse the repository at this point in the history
Signed-off-by: Masahiro Nakagawa <[email protected]>
  • Loading branch information
repeatedly committed Aug 31, 2020
1 parent 9917626 commit 251b3d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/fluent/plugin/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ def new_metadata(timekey: nil, tag: nil, variables: nil)
Metadata.new(timekey, tag, variables)
end

# Keep this method for existing code
def metadata(timekey: nil, tag: nil, variables: nil)
meta = Metadata.new(timekey, tag, variables)
Metadata.new(timekey, tag, variables)
end

def timekeys
Expand Down Expand Up @@ -794,11 +795,11 @@ def statistics
'total_queued_size' => stage_size + queue_size,
}

if (m = timekeys.min)
tkeys = timekeys
if (m = tkeys.min)
stats['oldest_timekey'] = m
end

if (m = timekeys.max)
if (m = tkeys.max)
stats['newest_timekey'] = m
end

Expand Down

0 comments on commit 251b3d8

Please sign in to comment.