Module: NewRelic::Agent::Instrumentation::Rails4::ActionView::NewRelic

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

Instance Method Summary collapse

Instance Method Details

#render_type(file_path) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/new_relic/agent/instrumentation/rails4/action_controller.rb', line 58

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



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

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