Class: NewRelic::Agent::TransactionEventAggregator

Inherits:
EventAggregator show all
Defined in:
lib/new_relic/agent/transaction_event_aggregator.rb

Instance Method Summary collapse

Methods inherited from EventAggregator

#after_initialize, buffer_class, capacity_key, #enabled?, enabled_fn, enabled_keys, #harvest!, #has_metadata?, #initialize, #merge!, named, #reset!

Constructor Details

This class inherits a constructor from NewRelic::Agent::EventAggregator

Instance Method Details

#record(priority: nil, event: nil, &blk) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/new_relic/agent/transaction_event_aggregator.rb', line 19

def record(priority: nil, event: nil, &blk)
  unless event || priority && blk
    raise ArgumentError, 'Expected priority and block, or event'
  end

  return unless enabled?

  @lock.synchronize do
    @buffer.append(priority: priority, event: event, &blk)
    notify_if_full
  end
end