Sometime, we need some evaluation of our code to see its robustness, performance, quality etc. These can be gather into a metrics, we will call it Rails Metrics. Fortunately, gems are available to provide all these metrics. A good detail of available metrics can be found here . I personally, feel that at start of your project, we should also set up tools to provide us with metrics under below category.
Metric 1: Code Quality
This will track our code quality in terms of best practice. Best Practices can be found on this site. it will show error in the metrics when we deviate from the best practices. The rails_best_practices gem can be used for this.
Metric 2: Code test coverage.
This metric will tell you, how much of your code is covered under different test cases and how much is left out. You can then add test cases for those piece of code. A no of tools are available for this on ruby tool box. The gem I preferred is simplecov . If you are using below ruby 1.9.x, you can also use rcov. rcov do not support ruby 1.9.x.
Metric 3: Code Performance
It will provide metrics about, your active record calls, method replication, query optimisation etc. newrelic provide performance testing service. Though, it is paid service. In Development mode you can use it for free. The newrelic rpm gem is available here
Metric 4: load metrics
This metric is generally needed for production. I have discussed in detail about various tools available for this in this post