Class: OneApm::Agent::SyntheticsEventBuffer
- Inherits:
-
SizedBuffer
- Object
- EventBuffer
- SizedBuffer
- OneApm::Agent::SyntheticsEventBuffer
- Defined in:
- lib/one_apm/support/event_buffer/synthetics_event_buffer.rb
Constant Summary collapse
- OA_TIMESTAMP =
"timestamp".freeze
Instance Attribute Summary
Attributes inherited from EventBuffer
Instance Method Summary collapse
Methods inherited from SizedBuffer
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_with_reject(x) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/one_apm/support/event_buffer/synthetics_event_buffer.rb', line 10 def append_with_reject(x) @seen += 1 if full? = (x) latest_event = @items.max_by do |item| (item) end if < (latest_event) # Make room! @items.delete(latest_event) return [append_event(x), latest_event] else return [nil, x] end else return [append_event(x), nil] end end |
#timestamp_for(event) ⇒ Object
32 33 34 35 |
# File 'lib/one_apm/support/event_buffer/synthetics_event_buffer.rb', line 32 def (event) main_event, _ = event main_event[OA_TIMESTAMP] end |