mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
9 lines
299 B
Ruby
9 lines
299 B
Ruby
require 'active_support/notifications'
|
|
|
|
ActiveSupport::Notifications.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
|