Add debug log for determining the number of output workers for output delegator

Fixes #4391
This commit is contained in:
Andrew Cholakian 2016-01-07 08:10:36 -06:00
parent 54cd6306fc
commit e492ff3aba
2 changed files with 6 additions and 0 deletions

View file

@ -31,6 +31,8 @@ module LogStash; class OutputDelegator
# DO NOT move this statement before the instantiation of the first single instance
# Read the note above to understand why
@worker_count = calculate_worker_count(default_worker_count)
@logger.debug("Will start workers for output", :worker_count => @worker_count, :class => klass)
warn_on_worker_override!
# This queue is used to manage sharing across threads
@worker_queue = SizedQueue.new(@worker_count)

View file

@ -115,6 +115,10 @@ describe LogStash::OutputDelegator do
let(:default_worker_count) { 2 }
let(:out_klass) { LogStash::Outputs::NOOPDelLegacyNoWorkers }
before do
allow(logger).to receive(:debug).with(any_args)
end
it "should only setup one worker" do
expect(subject.worker_count).to eql(1)
end