aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/instrument.rb
blob: 2c87ed7391801a7576e601e88f9e2bae47505bf6 (plain) (blame)
1
2
3
4
5
6
7
8
require 'active_support/orchestra'

ActiveSupport::Orchestra.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |event|
  if logger = ActionController::Base.logger
    human_name = event.name.to_s.humanize
    logger.info("#{human_name} (%.1fms)" % event.duration)
  end
end