kataring / fluent-plugin-string-scrub

fluent-plugin-string-scrub
MIT License
8 stars 9 forks source link

filter_string_scrub: use the new filter API #15

Closed GiedriusS closed 2 years ago

GiedriusS commented 2 years ago

Use the new filter API instead of filter_stream. Usage of the filter_stream API disables some optimizations as per the docs and logs:

disable filter chain optimization because [Fluent::Plugin::StringScrubFilter] uses `#filter_stream` method.

Docs: https://docs.fluentd.org/filter#filter-chain-optimization.

This new API has been implemented in ~2017 so I think it's safe to just switch to it.

Tests pass without any change:

Loaded suite /home/giedrius/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
.........
Finished in 0.052871143 seconds.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 tests, 40 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
170.23 tests/s, 756.56 assertions/s
kataring commented 2 years ago

Thanks.