Sha256: 6bd8cb0b50d0be0099667066d47ae92ae35966b402871bb65bbd3248df2c2be0
Contents?: true
Size: 522 Bytes
Versions: 15
Compression:
Stored size: 522 Bytes
Contents
class ProconBypassMan::Procon::PerformanceMeasurement::SpanTransferBuffer include Singleton def initialize @buff = [] end # @param [Span] # @return [void] def push_and_run_block_if_buffer_over(value, &block) push(value) return unless buffer_over? block.call(spans) clear end private def spans @buff end def clear @buff.clear end def push(value) @buff << value end def buffer_over? @buff.length > max_buffer end def max_buffer 50 end end
Version data entries
15 entries across 15 versions & 1 rubygems