class NewRelic::Agent::SyntheticsEventBuffer
Constants
- TIMESTAMP
Public Instance Methods
append_with_reject(x)
click to toggle source
# File lib/new_relic/agent/synthetics_event_buffer.rb, line 10 def append_with_reject(x) @seen += 1 if full? timestamp = timestamp_for(x) latest_event = @items.max_by do |item| timestamp_for(item) end if timestamp < timestamp_for(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)
click to toggle source
# File lib/new_relic/agent/synthetics_event_buffer.rb, line 32 def timestamp_for(event) main_event, _ = event main_event[TIMESTAMP] end