Class: AlacrityRails::Probe::ActionController

Inherits:
Object
  • Object
show all
Defined in:
lib/alacrity-rails/probe/action_controller.rb

Class Method Summary collapse

Class Method Details

.activateObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/alacrity-rails/probe/action_controller.rb', line 4

def self.activate
  ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |name, started, finished, unique_id, data|
    AlacrityRails::Client.store_request(
      controller: data[:controller],
      action: data[:action],
      format: data[:format]
    )

    AlacrityRails::Client.store_timeline_event(
      event_type: 'framework',
      engine: 'ActionController',
      started_at: started,
      finished_at: finished,
    )
  end
end