- Set input thread names to "<" followed by the plugin name

- Set output thread names to ">" followed by the plugin name
- Set filter worker threads names to "|" followed by "worker.N" where N
  is the worker number.
This commit is contained in:
Jordan Sissel 2013-01-17 00:04:10 -05:00
parent e9953458d9
commit f94fa34f38

View file

@ -702,7 +702,7 @@ class LogStash::Agent
private private
def run_input(input, queue) def run_input(input, queue)
LogStash::Util::set_thread_name("input|#{input.to_s}") LogStash::Util::set_thread_name("<#{input.class.config_name}")
input.logger = @logger input.logger = @logger
@plugin_setup_mutex.synchronize { input.register } @plugin_setup_mutex.synchronize { input.register }
@logger.info("Input registered", :plugin => input) @logger.info("Input registered", :plugin => input)
@ -734,7 +734,7 @@ class LogStash::Agent
# Run a filter thread # Run a filter thread
public public
def run_filter(filterworker, index, output_queue) def run_filter(filterworker, index, output_queue)
LogStash::Util::set_thread_name("filter|worker|#{index}") LogStash::Util::set_thread_name("|worker.#{index}")
filterworker.run filterworker.run
@logger.warn("Filter worker shutting down", :index => index) @logger.warn("Filter worker shutting down", :index => index)
@ -744,7 +744,7 @@ class LogStash::Agent
# TODO(sissel): Factor this into an 'outputworker' # TODO(sissel): Factor this into an 'outputworker'
def run_output(output, queue) def run_output(output, queue)
LogStash::Util::set_thread_name("output|#{output.to_s}") LogStash::Util::set_thread_name(">#{output.class.config_name}")
output.logger = @logger output.logger = @logger
@plugin_setup_mutex.synchronize { output.register } @plugin_setup_mutex.synchronize { output.register }
@logger.info("Output registered", :plugin => output) @logger.info("Output registered", :plugin => output)