logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb
# We generally only want one thread at a time able to access pop/take/poll operations
# from this queue. We also depend on this to be able to block consumers while we snapshot
# in-flight buffers
We generally only want one thread at a time able to access pop/take/poll operations
from this queue. We also depend on this to be able to block consumers while we snapshot
in-flight buffers
We generally only want one thread at a time able to access pop / take / poll operations from this queue . We also depend on this to be able to block consumers while we snapshot in - flight buffers
def close_batch(batch)
        thread = Thread.current
        @inflight_batches.delete(thread)
        start_time = @inflight_clocks.get_and_set(thread, nil)
        unless start_time.nil?
          if batch.size > 0
            time_taken = (java.lang.System.nano_time - start_time) / 1_000_000
            @event_metric_time.increment(time_taken)
            @pipeline_metric_time.increment(time_taken)
          end
        end
      end
def close_batch ( batch ) thread = Thread . current @inflight_batches . delete ( thread ) start_time = @inflight_clocks . get_and_set ( thread , nil ) unless start_time . nil? if batch . size > 0 time_taken = ( java . lang . System . nano_time - start_time ) / 1_000_000 @event_metric_time . increment ( time_taken ) @pipeline_metric_time . increment ( time_taken ) end end end
We generally only want one thread at a time able to access pop/take/poll operations
from this queue.
We generally only want one thread at a time able to access pop / take / poll operations from this queue .
# only stop (which also records) the metrics if the batch is non-empty. # start_clock is now called at empty batch creation and an empty batch could # stay empty all the way down to the close_batch call.
batch
<not_specific>