diff options
author | José Valim <jose.valim@gmail.com> | 2009-09-19 12:31:47 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-09-20 10:56:38 -0300 |
commit | 7cc1c2e71da1ad277acc7a7664321d2224a56bb8 (patch) | |
tree | 3a0aa4da485ebadb82f0e98d983994de02aa64f0 /actionpack/lib/abstract_controller/benchmarker.rb | |
parent | 8f47f311b7665d74220baf1449b39dc4e70e13e2 (diff) | |
download | rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.tar.gz rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.tar.bz2 rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.zip |
Add Orchestra instrumentation to fragment and page caching.
Diffstat (limited to 'actionpack/lib/abstract_controller/benchmarker.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/benchmarker.rb | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/actionpack/lib/abstract_controller/benchmarker.rb b/actionpack/lib/abstract_controller/benchmarker.rb deleted file mode 100644 index 58e9564c2f..0000000000 --- a/actionpack/lib/abstract_controller/benchmarker.rb +++ /dev/null @@ -1,38 +0,0 @@ -module AbstractController - module Benchmarker - extend ActiveSupport::Concern - - include Logger - - module ClassMethods - # Execute the passed in block, timing the duration of the block in ms. - # - # ==== Parameters - # title<#to_s>:: The title of block to benchmark - # log_level<Integer>:: A valid log level. Defaults to Logger::DEBUG - # use_silence<TrueClass, FalseClass>:: Whether or not to silence the - # logger for the duration of the block. - # - # ==== Returns - # Object:: The result of the block - def benchmark(title, log_level = ::Logger::DEBUG, use_silence = true) - if logger && logger.level >= log_level - result = nil - ms = Benchmark.ms { result = use_silence ? silence { yield } : yield } - logger.add(log_level, "#{title} (#{('%.1f' % ms)}ms)") - result - else - yield - end - end - - # Silences the logger for the duration of the block. - def silence - old_logger_level, logger.level = logger.level, ::Logger::ERROR if logger - yield - ensure - logger.level = old_logger_level if logger - end - end - end -end |