mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
11 lines
357 B
Ruby
11 lines
357 B
Ruby
require 'active_support/notifications'
|
|
|
|
ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |*args|
|
|
event = ActiveSupport::Notifications::Event.new(*args)
|
|
|
|
if logger = ActionController::Base.logger
|
|
human_name = event.name.to_s.humanize
|
|
logger.info("#{human_name} (%.1fms)" % event.duration)
|
|
end
|
|
end
|