class RuntimeProfiler::Callback::ActionController

Attributes

data[R]

Public Class Methods

new() click to toggle source
# File lib/runtime_profiler/callbacks/action_controller.rb, line 8
def initialize
  @data = {}
end

Public Instance Methods

call(*args) click to toggle source
# File lib/runtime_profiler/callbacks/action_controller.rb, line 12
def call(*args)
  event = RuntimeProfiler::ProcessActionEvent.new(args: args)
  return unless event.recordable?

  add event
end
controller_data() click to toggle source
# File lib/runtime_profiler/callbacks/action_controller.rb, line 19
def controller_data
  data.values.first
end

Private Instance Methods

add(event) click to toggle source
# File lib/runtime_profiler/callbacks/action_controller.rb, line 25
def add(event)
  key = event.key
  @data[key] = {}

  @data[key][:path]           = event.path
  @data[key][:total_runtime]  = event.total_runtime
  @data[key][:db_runtime]     = event.db_runtime
  @data[key][:view_runtime]   = event.view_runtime
  @data[key][:payload]        = event.payload
end