Class: LogStash::Util::WorkerThreadsDefaultPrinter
- Inherits:
-
Object
- Object
- LogStash::Util::WorkerThreadsDefaultPrinter
- Defined in:
- lib/logstash/util/worker_threads_default_printer.rb
Instance Method Summary collapse
-
#initialize(settings) ⇒ WorkerThreadsDefaultPrinter
constructor
A new instance of WorkerThreadsDefaultPrinter.
- #visit(collector) ⇒ Object
- #visit_default(collector) ⇒ Object
- #visit_setting(collector) ⇒ Object
Constructor Details
#initialize(settings) ⇒ WorkerThreadsDefaultPrinter
Returns a new instance of WorkerThreadsDefaultPrinter.
7 8 9 10 |
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 7 def initialize(settings) @setting = settings.fetch('pipeline.workers', 0) @default = settings.fetch('default-pipeline-workers', 0) end |
Instance Method Details
#visit(collector) ⇒ Object
12 13 14 15 |
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 12 def visit(collector) visit_setting(collector) visit_default(collector) end |
#visit_default(collector) ⇒ Object
22 23 24 25 |
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 22 def visit_default(collector) return if @default == 0 collector.push "Default pipeline workers: #{@default}" end |
#visit_setting(collector) ⇒ Object
17 18 19 20 |
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 17 def visit_setting(collector) return if @setting == 0 collector.push("User set pipeline workers: #{@setting}") end |