module Searchkick::ControllerRuntime

Protected Instance Methods

append_info_to_payload(payload) click to toggle source
Calls superclass method
# File lib/searchkick/controller_runtime.rb, line 26
def append_info_to_payload(payload)
  super
  payload[:searchkick_runtime] = (searchkick_runtime || 0) + Searchkick::LogSubscriber.reset_runtime
end
cleanup_view_runtime() click to toggle source
Calls superclass method
# File lib/searchkick/controller_runtime.rb, line 18
def cleanup_view_runtime
  searchkick_rt_before_render = Searchkick::LogSubscriber.reset_runtime
  runtime = super
  searchkick_rt_after_render = Searchkick::LogSubscriber.reset_runtime
  self.searchkick_runtime = searchkick_rt_before_render + searchkick_rt_after_render
  runtime - searchkick_rt_after_render
end
process_action(action, *args) click to toggle source
Calls superclass method
# File lib/searchkick/controller_runtime.rb, line 10
def process_action(action, *args)
  # We also need to reset the runtime before each action
  # because of queries in middleware or in cases we are streaming
  # and it won't be cleaned up by the method below.
  Searchkick::LogSubscriber.reset_runtime
  super
end