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



54
55
56
57
58
59
60
61
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 54

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



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 42

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