module TingYun::Instrumentation::Rails3::ActionView

Public Instance Methods

render_type(file_path) click to toggle source
# File lib/ting_yun/instrumentation/rails3/action_view.rb, line 23
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 = {}) click to toggle source
# File lib/ting_yun/instrumentation/rails3/action_view.rb, line 12
def template_metric(identifier, options = {})
  if options[:file]
    "file"
  elsif identifier.nil?
    ::TingYun::Agent::UNKNOWN_METRIC
  elsif identifier.include? '/' # this is a filepath
    identifier.split('/')[-2..-1].join('/')
  else
    identifier
  end
end