Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log messages and its conditions #1227

Merged
merged 4 commits into from
Sep 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/fluent/event_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,14 @@ def optimized_filter_stream(tag, es)

def optimizable?
return @optimizable unless @optimizable.nil?
@optimizable = if filters_having_filter_stream.empty?
fs_filters = filters_having_filter_stream
@optimizable = if fs_filters.empty?
true
else
$log.info "Filtering works with worse performance, because #{filters_having_filter_stream.map(&:class)} uses `#filter_stream` method."
# skip log message when filter is only 1, because its performace is same as non optimized chain.
if @filters.size > 1 && fs_filters.size >= 1
$log.info "disable filter chain optimization because #{fs_filters.map(&:class)} uses `#filter_stream` method."
end
false
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/fluent/plugin/storage_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def configure(conf)
elsif @path
# ok
else # @_plugin_id_configured is true
raise NotImplementedError, "implement this feature later with system_config"
log.warn "path for <storage> is not specified. Using on-memory store temporarily, but will use file store after support global storage path"
@on_memory = true
## TODO: get process-wide directory for plugin storage, and generate path for this plugin storage instance
# path =
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_event_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def filter_with_time(tag, time, record); end

e = OneEventStream.new(@now, @record)
assert_rr do
mock($log).info("Filtering works with worse performance, because #{[filter_stream].map(&:class)} uses `#filter_stream` method.")
mock($log).info("disable filter chain optimization because #{[filter_stream].map(&:class)} uses `#filter_stream` method.")
mock(filter_stream).filter_stream('test', is_a(OneEventStream)) { e }
mock(filter).filter_stream('test', is_a(OneEventStream)) { e }
mock(filter_with_time).filter_stream('test', is_a(OneEventStream)) { e }
Expand Down