Method: NewRelic::Agent::Instrumentation::ControllerInstrumentation::ClassMethods#newrelic_ignore_aspect

Defined in:
lib/new_relic/agent/instrumentation/controller_instrumentation.rb

#newrelic_ignore_aspect(property, specifiers = {}) ⇒ Object

:nodoc:

[View source]

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/new_relic/agent/instrumentation/controller_instrumentation.rb', line 81

def newrelic_ignore_aspect(property, specifiers = {}) # :nodoc:
  if specifiers.empty?
    self.newrelic_write_attr(property, true)
  elsif !(Hash === specifiers)
    ::NewRelic::Agent.logger.error("newrelic_#{property} takes an optional hash with :only and :except lists of actions (illegal argument type '#{specifiers.class}')")
  else
    # symbolize the incoming values
    specifiers = specifiers.inject({}) do |memo, (key, values)|
      if values.is_a?(Array)
        memo[key] = values.map(&:to_sym)
      else
        memo[key] = values.to_sym
      end
      memo
    end
    self.newrelic_write_attr(property, specifiers)
  end
end