Module: NewRelic::Agent::Instrumentation::Bunny

Included in:
Consumer, Exchange, Queue
Defined in:
lib/new_relic/agent/instrumentation/bunny/instrumentation.rb

Defined Under Namespace

Modules: Chain, Consumer, Exchange, Prepend, Queue

Constant Summary collapse

LIBRARY =
'RabbitMQ'
DEFAULT_NAME =
'Default'
DEFAULT_TYPE =
:direct
SLASH =
'/'
INSTRUMENTATION_NAME =
NewRelic::Agent.base_name(name)

Class Method Summary collapse

Class Method Details

.exchange_name(name) ⇒ Object



17
18
19
# File 'lib/new_relic/agent/instrumentation/bunny/instrumentation.rb', line 17

def exchange_name(name)
  name.empty? ? DEFAULT_NAME : name
end

.exchange_type(delivery_info, channel) ⇒ Object



21
22
23
24
25
26
# File 'lib/new_relic/agent/instrumentation/bunny/instrumentation.rb', line 21

def exchange_type(delivery_info, channel)
  if di_exchange = delivery_info[:exchange]
    return DEFAULT_TYPE if di_exchange.empty?
    return channel.exchanges[delivery_info[:exchange]].type if channel.exchanges[di_exchange]
  end
end