Module: TraceView::Inst::ActionController
- Includes:
- RailsBase
- Defined in:
- lib/traceview/frameworks/rails/inst/action_controller2.rb,
lib/traceview/frameworks/rails/inst/action_controller3.rb,
lib/traceview/frameworks/rails/inst/action_controller4.rb,
lib/traceview/frameworks/rails/inst/action_controller5.rb
Overview
ActionController
This modules contains the instrumentation code specific to Rails v5
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from RailsBase
#has_handler?, #log_rails_error?
Instance Method Details
33
34
35
36
37
38
39
40
41
42
|
# 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) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# 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(method_name, *args) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# 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) ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# 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) ⇒ Object
render_with_traceview
Our render wrapper that just times and conditionally reports raised exceptions
38
39
40
41
42
43
44
45
46
47
|
# 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) ⇒ Object
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/traceview/frameworks/rails/inst/action_controller2.rb', line 49
def render_with_traceview(options = nil, = {}, &block)
TraceView::API.log_entry('actionview')
render_without_traceview(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) ⇒ Object
44
45
46
47
|
# 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
|