module Sequel::Railties::ControllerRuntime

Private Instance Methods

append_info_to_payload(payload) click to toggle source
Calls superclass method
# File lib/sequel/railties/controller_runtime.rb, line 52
def append_info_to_payload payload
  super
  payload[:db_runtime] =
    (db_runtime || 0) + RailsSemanticLogger::Sequel::LogSubscriber.reset_runtime
  payload[:db_query_count] =
    (db_query_count || 0) + RailsSemanticLogger::Sequel::LogSubscriber.reset_count
end
cleanup_view_runtime() click to toggle source
Calls superclass method
# File lib/sequel/railties/controller_runtime.rb, line 39
def cleanup_view_runtime
  if logger && logger.info?
    db_rt_before_render = RailsSemanticLogger::Sequel::LogSubscriber.reset_runtime
    self.db_runtime = (db_runtime || 0) + db_rt_before_render
    runtime = super
    db_rt_after_render = RailsSemanticLogger::Sequel::LogSubscriber.reset_runtime
    self.db_runtime += db_rt_after_render
    runtime - db_rt_after_render
  else
    super
  end
end
process_action(action, *args) click to toggle source
Calls superclass method
# File lib/sequel/railties/controller_runtime.rb, line 30
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.
  RailsSemanticLogger::Sequel::LogSubscriber.reset_runtime
  RailsSemanticLogger::Sequel::LogSubscriber.reset_count
  super
end