From Jeffrey Damick
This gem provides a metrics collecting for controllers, database queries, and specific blocks of code or methods. It is designed to be light-weight and have minimal impact on production builds while providing performance indicators of the running application.
This software is released to be used at your own risk. For feedback please drop us a line at rails-trunk [ at ] revolution DOT com.
Using this plugin should not be your first step in application optimization/scaling or even the second one.
[ERROR] [2007-06-21 23:21:19] [trunk] [Metrics]||[MysqlAdapter.log]|0.012727|args=["root localhost trunk_test", "CREATE DATABASE `trunk_test`"]
[ERROR] [2007-06-21 23:19:56] [trunk] [Metrics]||[Request to [Test::SomeControllerWithMetricsId]]|0.001373|action = index|path =some?
[ERROR] [2007-06-21 23:19:56] [trunk] [Metrics]||[SomeClassToUseModuleMixin.another_method]|0.000020|args=["also"]
for more samples and test cases see test/metrics_test.rb
The metrics are written to: logs/
Configuration can be updated in metrics/config/metrics.yml, you may copy this file to your RAILS_ROOT/config/metrics.yml and customize for your application, the RAILS_ROOT will be checked first.
script/plugin install svn://rubyforge.org/var/svn/metrics/trunk/vendor/plugins/metrics
metrics is released under the MIT license.
The plugin RubyForge page is http://rubyforge.org/projects/metrics