module TraceView::Inst::ActionController

ActionController

This modules contains the instrumentation code specific to Rails v2

ActionController

This modules contains the instrumentation code specific to Rails v3

ActionController

This modules contains the instrumentation code specific to Rails v4

ActionController

This modules contains the instrumentation code specific to Rails v5

Public Class Methods

included(klass) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller2.rb, line 15
def self.included(klass)
  ::TraceView::Util.method_alias(klass, :perform_action)
  ::TraceView::Util.method_alias(klass, :rescue_action)
  ::TraceView::Util.method_alias(klass, :process)
  ::TraceView::Util.method_alias(klass, :render)
end

Public Instance Methods

perform_action_with_traceview(*arguments) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller2.rb, line 33
def perform_action_with_traceview(*arguments)
  kvs = {
    :Controller  => @_request.path_parameters['controller'],
    :Action      => @_request.path_parameters['action']
  }
  kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:action_controller][:collect_backtraces]

  TraceView::API.log(nil, 'info', kvs)
  perform_action_without_traceview(*arguments)
end
process_action(method_name, *args) click to toggle source
Calls superclass method
# File lib/traceview/frameworks/rails/inst/action_controller5.rb, line 15
def process_action(method_name, *args)
  kvs = {
    :Controller   => self.class.name,
    :Action       => self.action_name,
  }
  kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:action_controller][:collect_backtraces]

  TraceView::API.log_entry('rails', kvs)
  super(method_name, *args)

rescue Exception => e
  TraceView::API.log_exception(nil, e) if log_rails_error?(e)
  raise
ensure
  TraceView::API.log_exit('rails')
end
process_action_with_traceview(*args) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller3.rb, line 34
def process_action_with_traceview(*args)
  kvs = {
    :Controller   => self.class.name,
    :Action       => action_name,
  }
  kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:action_controller][:collect_backtraces]
  TraceView::API.log(nil, 'info', kvs)

  process_action_without_traceview(*args)
rescue Exception
  kvs[:Status] = 500
  TraceView::API.log(nil, 'info', kvs)
  raise
end
process_with_traceview(*args) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller2.rb, line 22
def process_with_traceview(*args)
  TraceView::API.log_entry('rails')
  process_without_traceview(*args)

rescue Exception => e
  TraceView::API.log_exception(nil, e) if log_rails_error?(e)
  raise
ensure
  TraceView::API.log_exit('rails')
end
render(*args, &blk) click to toggle source

render_with_traceview

Our render wrapper that just times and conditionally reports raised exceptions

Calls superclass method
# File lib/traceview/frameworks/rails/inst/action_controller5.rb, line 38
def render(*args, &blk)
  TraceView::API.log_entry('actionview')
  super(*args, &blk)

rescue Exception => e
  TraceView::API.log_exception(nil, e) if log_rails_error?(e)
  raise
ensure
  TraceView::API.log_exit('actionview')
end
render_with_traceview(options = nil, extra_options = {}, &block) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller2.rb, line 49
def render_with_traceview(options = nil, extra_options = {}, &block)
  TraceView::API.log_entry('actionview')
  render_without_traceview(options, extra_options, &block)

rescue Exception => e
  TraceView::API.log_exception(nil, e) if log_rails_error?(e)
  raise
ensure
  TraceView::API.log_exit('actionview')
end
rescue_action_with_traceview(exn) click to toggle source
# File lib/traceview/frameworks/rails/inst/action_controller2.rb, line 44
def rescue_action_with_traceview(exn)
  TraceView::API.log_exception(nil, exn) if log_rails_error?(exn)
  rescue_action_without_traceview(exn)
end