aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-12-27 14:36:59 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-12-27 14:36:59 -0800
commit12e43494a748e0144195be12dc19161cc3e4d39f (patch)
treec06f88b7ddf6e41205838cc6f4edd2257a801dcb /actionpack/lib/action_controller/caching.rb
parent1c26ba486c23f229a12fea6ccad33e6cb3122b91 (diff)
parent97db79ab3c0af7b6805dcaee99384d96ccb3567d (diff)
downloadrails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.gz
rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.bz2
rails-12e43494a748e0144195be12dc19161cc3e4d39f.zip
Merge remote branch 'jose/perf'
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r--actionpack/lib/action_controller/caching.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index d784138ebe..69ed84da95 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -60,6 +60,17 @@ module ActionController #:nodoc:
def cache_configured?
perform_caching && cache_store
end
+
+ def log_event(name, before, after, instrumenter_id, payload)
+ if name.to_s =~ /(read|write|cache|expire|exist)_(fragment|page)\??/
+ key_or_path = payload[:key] || payload[:path]
+ human_name = name.to_s.humanize
+ duration = (after - before) * 1000
+ logger.info("#{human_name} #{key_or_path.inspect} (%.1fms)" % duration)
+ else
+ super
+ end
+ end
end
def caching_allowed?