Skip to content

Commit

Permalink
display Java pipeline initialization time
Browse files Browse the repository at this point in the history
  • Loading branch information
colinsurprenant committed Jun 1, 2020
1 parent e47426d commit 0c38004
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logstash-core/lib/logstash/java_pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,16 @@ def start_workers
# First launch WorkerLoop initialization in separate threads which concurrently
# compiles and initializes the worker pipelines

workers_init_start = Time.now
worker_loops = pipeline_workers.times
.map { Thread.new { init_worker_loop } }
.map(&:value)
workers_init_elapsed = Time.now - workers_init_start

fail("Some worker(s) were not correctly initialized") if worker_loops.any?{|v| v.nil?}

@logger.info("Pipeline Java execution initialization time", "seconds" => workers_init_elapsed.round(2))

# Once all WorkerLoop have been initialized run them in separate threads

worker_loops.each_with_index do |worker_loop, t|
Expand Down

0 comments on commit 0c38004

Please sign in to comment.