Module: TraceView::Inst::ActionController3

Includes:
RailsBase
Included in:
ActionController::Base
Defined in:
lib/traceview/frameworks/rails/inst/action_controller.rb

Overview

ActionController3

This modules contains the instrumentation code specific to Rails v3

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RailsBase

#has_handler?, #log_rails_error?, #render_with_traceview

Class Method Details

.included(base) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/traceview/frameworks/rails/inst/action_controller.rb', line 82

def self.included(base)
  base.class_eval do
    alias_method_chain :process, :traceview
    alias_method_chain :process_action, :traceview
    alias_method_chain :render, :traceview
  end
end

Instance Method Details

#process_action_with_traceview(*args) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/traceview/frameworks/rails/inst/action_controller.rb', line 101

def process_action_with_traceview(*args)
  report_kvs = {
    :Controller   => self.class.name,
    :Action       => self.action_name,
  }
  TraceView::API.log(nil, 'info', report_kvs)

  process_action_without_traceview *args
rescue Exception
  report_kvs[:Status] = 500
  TraceView::API.log(nil, 'info', report_kvs)
  raise
end

#process_with_traceview(*args) ⇒ Object



90
91
92
93
94
95
96
97
98
99
# File 'lib/traceview/frameworks/rails/inst/action_controller.rb', line 90

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