Class: OneApm::Agent::SizedBuffer

Inherits:
EventBuffer show all
Defined in:
lib/one_apm/support/event_buffer/sized_buffer.rb

Direct Known Subclasses

SyntheticsEventBuffer

Instance Attribute Summary

Attributes inherited from EventBuffer

#capacity

Instance Method Summary collapse

Methods inherited from EventBuffer

#<<, #append, #full?, #initialize, #note_dropped, #num_dropped, #num_seen, #reset!, #sample_rate, #size, #to_a

Constructor Details

This class inherits a constructor from OneApm::Agent::EventBuffer

Instance Method Details

#append_event(x) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/one_apm/support/event_buffer/sized_buffer.rb', line 9

def append_event(x)
  if @items.size < @capacity
    @items << x
    return x
  else
    return nil
  end
end