lib/scrivito/controller_runtime.rb in scrivito_sdk-0.65.2 vs lib/scrivito/controller_runtime.rb in scrivito_sdk-0.66.0.rc1

- old
+ new

@@ -5,30 +5,38 @@ module ControllerRuntime extend ActiveSupport::Concern protected - attr_internal :rc_runtime + attr_internal :scrivito_runtime def cleanup_view_runtime - rc_rt_before_render = Scrivito::LogSubscriber.reset_runtime + self.scrivito_runtime = reset_scrivito_runtime + runtime = super - rc_rt_after_render = Scrivito::LogSubscriber.reset_runtime - self.rc_runtime = rc_rt_before_render + rc_rt_after_render - runtime - rc_rt_after_render + + scrivito_rt_after_render = reset_scrivito_runtime + self.scrivito_runtime += scrivito_rt_after_render + + runtime - scrivito_rt_after_render end def append_info_to_payload(payload) super - payload[:rc_runtime] = rc_runtime + payload[:scrivito_runtime] = + (self.scrivito_runtime || 0) + reset_scrivito_runtime end module ClassMethods def log_process_action(payload) - messages, rc_runtime = super, payload[:rc_runtime] - messages << ("Scrivito: %.1fms" % rc_runtime.to_f) + messages, scrivito_runtime = super, payload[:scrivito_runtime] + messages << ("Scrivito: %.1fms" % scrivito_runtime.to_f) messages end + end + + def reset_scrivito_runtime + Scrivito::LogSubscriber.reset_runtime end end end # module Scrivito