Class: Debugbar::ActionControllerEventSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/debugbar/subscribers/action_controller.rb

Class Method Summary collapse

Class Method Details

.process_action(event) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/debugbar/subscribers/action_controller.rb', line 10

def process_action(event)
  return if Debugbar::Current.ignore?

  meta = event.payload

  meta.delete :headers
  request = meta.delete :request
  response = meta.delete :response

  meta.merge!({
    duration: event.duration,
    cpu_time: event.cpu_time,
    idle_time: event.idle_time,
    allocations: event.allocations,
  })

  Debugbar::Tracker.request = request
  Debugbar::Tracker.response = response
  Debugbar::Tracker.meta = meta
end

.start_processing(event) ⇒ Object



4
5
6
7
8
# File 'lib/debugbar/subscribers/action_controller.rb', line 4

def start_processing(event)
  return if Debugbar::Current.ignore?

  Debugbar::Tracker.request = event.payload[:request]
end