diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 3cd9363b3e..9eda2ab47d 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -82,7 +82,7 @@ def initialize desc 'The number of reading lines at each IO.' config_param :read_lines_limit, :integer, default: 1000 desc 'The number of reading bytes per second' - config_param :read_bytes_limit_per_second, :integer, default: -1 + config_param :read_bytes_limit_per_second, :size, default: -1 desc 'The interval of flushing the buffer for multiline format' config_param :multiline_flush_interval, :time, default: nil desc 'Enable the option to emit unmatched lines.' diff --git a/test/plugin/test_in_tail.rb b/test/plugin/test_in_tail.rb index a2d62c6396..105ef74a2f 100644 --- a/test/plugin/test_in_tail.rb +++ b/test/plugin/test_in_tail.rb @@ -252,10 +252,14 @@ def test_emit_with_read_lines_limit(data) FileUtils.rm_f("#{TMP_DIR}/tail.txt") end - data("flat 8192 bytes, 10 events" => [:flat, 100, 8192, 10], - "flat #{8192*10} bytes, 20 events" => [:flat, 100, (8192 * 10), 20], - "parse #{8192*3} bytes, 10 events" => [:parse, 100, (8192 * 3), 10], - "parse #{8192*10} bytes, 20 events" => [:parse, 100, (8192 * 10), 20]) + data("flat 8192 bytes, 10 events" => [:flat, 100, 8192, 10], + "flat #{8192*10} bytes, 20 events" => [:flat, 100, (8192 * 10), 20], + "parse #{8192*3} bytes, 10 events" => [:parse, 100, (8192 * 3), 10], + "parse #{8192*10} bytes, 20 events" => [:parse, 100, (8192 * 10), 20], + "flat 8k bytes with unit, 10 events" => [:flat, 100, "8k", 10], + "flat #{8*10}k bytes with unit, 20 events" => [:flat, 100, "#{8*10}k", 20], + "parse #{8*3}k bytes with unit, 10 events" => [:parse, 100, "#{8*3}k", 10], + "parse #{8*10}k bytes with unit, 20 events" => [:parse, 100, "#{8*10}k", 20]) def test_emit_with_read_bytes_limit_per_second(data) config_style, limit, limit_bytes, num_events = data case config_style