aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/abstract/benchmarker.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-08 16:14:38 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-08 16:15:14 -0700
commit38b608ecab2441cd0c4e75bc08bdf57fcf85dd71 (patch)
treeae901461df0ebe6b065b89a5db201d08fd5dda92 /actionpack/lib/action_controller/abstract/benchmarker.rb
parenta470bb36128cfdddd888492b7ac972ee582f6acb (diff)
downloadrails-38b608ecab2441cd0c4e75bc08bdf57fcf85dd71.tar.gz
rails-38b608ecab2441cd0c4e75bc08bdf57fcf85dd71.tar.bz2
rails-38b608ecab2441cd0c4e75bc08bdf57fcf85dd71.zip
Writing comments to AbstractController
Diffstat (limited to 'actionpack/lib/action_controller/abstract/benchmarker.rb')
-rw-r--r--actionpack/lib/action_controller/abstract/benchmarker.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/abstract/benchmarker.rb b/actionpack/lib/action_controller/abstract/benchmarker.rb
index 07294cede3..58e9564c2f 100644
--- a/actionpack/lib/action_controller/abstract/benchmarker.rb
+++ b/actionpack/lib/action_controller/abstract/benchmarker.rb
@@ -5,6 +5,16 @@ module AbstractController
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