Module: NoBrainer::Profiler::ControllerRuntime::ClassMethods

Defined in:
lib/no_brainer/profiler/controller_runtime.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#log_process_action(payload) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/no_brainer/profiler/controller_runtime.rb', line 66

def log_process_action(payload)
  messages, profiler = super, payload[:nobrainer_profiler]
  if profiler && !profiler.total_duration.zero?
    msg = []
    msg << "%.1fms (write)" % (profiler.write_duration * 1000) unless profiler.write_duration.zero?
    msg << "%.1fms (read)"  % (profiler.read_duration  * 1000) unless profiler.read_duration.zero?
    msg << "%.1fms (other)" % (profiler.other_duration * 1000) unless profiler.other_duration.zero?
    messages << "NoBrainer: #{msg.join(", ")}"
  end
  messages
end