Class: ProconBypassMan::Procon::PerformanceMeasurement::SpanTransferBuffer

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/procon_bypass_man/procon/performance_measurement/span_transfer_buffer.rb

Instance Method Summary collapse

Constructor Details

#initializeSpanTransferBuffer

Returns a new instance of SpanTransferBuffer.



4
5
6
# File 'lib/procon_bypass_man/procon/performance_measurement/span_transfer_buffer.rb', line 4

def initialize
  @buff = []
end

Instance Method Details

#push_and_run_block_if_buffer_over(value, &block) ⇒ void

This method returns an undefined value.

Parameters:

  • (Span)


10
11
12
13
14
15
16
# File 'lib/procon_bypass_man/procon/performance_measurement/span_transfer_buffer.rb', line 10

def push_and_run_block_if_buffer_over(value, &block)
  push(value)
  return unless buffer_over?

  block.call(spans)
  clear
end