custom_benchmarks
Custom Benchmarks allow you to easily add your own information to the <br />benchmark line logged at the end of each request. e.g.,</p>
<p>Completed in 0.40306 (2 reqs/sec) | Rendering: 0.05003 (12%) | DB: 0.04571 (11%) | Search: 0.16429,1 (40%) | PID: 22426 | 200 OK [http://www.zvents.com/welcome/index]</p>
<p>Typically, the log line includes the latency associated with executing <br />specific parts of a request. In the example above, we have added a <br />measurement of search latency. But you can use Custom Benchmarks to add <br />any information to the log line. The example above also shows the ID of <br />the process (PID) that served this request. The PID is useful when parsing <br />information from logs that contain data from multiple processes.</p>
<p>Adding your own information is as easy as:</p>
<p>class ApplicationController < ActionController::Base <br /> custom_benchmark {|runtime| ” | PID: #{$$}” } <br /> ... <br />end</p>
<p>
- Repository Path: svn://rubyforge.org/var/svn/zventstools/projects/custom_benchmarks
- Homepage: http://blog.zvents.com/2006/10/31/rails-plugin-custom-benchmarks