Module: NewRelic::Agent::Instrumentation::Rails3::ActionView::NewRelic

Extended by:
NewRelic
Included in:
NewRelic
Defined in:
lib/new_relic/agent/instrumentation/rails3/action_controller.rb

Instance Method Summary collapse

Instance Method Details

#render_type(file_path) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 50

def render_type(file_path)
  file = File.basename(file_path)
  if file.starts_with?('_')
    return 'Partial'
  else
    return 'Rendering'
  end
end

#template_metric(identifier, options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 38

def template_metric(identifier, options = {})
  if options[:file]
    'file'
  elsif identifier.nil?
    ::NewRelic::Agent::UNKNOWN_METRIC
  elsif identifier.include?('/') # this is a filepath
    identifier.split('/')[-2..-1].join('/')
  else
    identifier
  end
end