Class: LogStash::Util::WorkerThreadsDefaultPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/util/worker_threads_default_printer.rb

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WorkerThreadsDefaultPrinter

Returns a new instance of WorkerThreadsDefaultPrinter.



8
9
10
11
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 8

def initialize(settings)
  @setting = settings.fetch('pipeline.workers', 0)
  @default = settings.fetch('default-pipeline-workers', 0)
end

Instance Method Details

#visit(collector) ⇒ Object



13
14
15
16
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 13

def visit(collector)
  visit_setting(collector)
  visit_default(collector)
end

#visit_default(collector) ⇒ Object



23
24
25
26
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 23

def visit_default(collector)
  return if @default == 0
  collector.push "Default pipeline workers: #{@default}"
end

#visit_setting(collector) ⇒ Object



18
19
20
21
# File 'lib/logstash/util/worker_threads_default_printer.rb', line 18

def visit_setting(collector)
  return if @setting == 0
  collector.push("User set pipeline workers: #{@setting}")
end