0.04
No commit activity in last 3 years
No release in over 3 years
ActionCost measures the performance of a Rails 3 app controller actions in terms of number of calls to the database and to RecordCache.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 1.8.4
~> 3.12
 Project Readme

ActionCost¶ ↑

ActionCost is a Rails 3 engine implemented as a gem. It hooks into ActiveRecord (and RecordCache if used) and counts the number of SQL queries per controller action and per table.

Setup¶ ↑

Simply include action_cost into your Rails 3 application Gemfile.

gem 'action_cost', '0.0.1'

In some applications it’s also necessary to add routes in #{Rails.root}/config/routes.rb for the ActionCost dashboard pages:

namespace :action_cost do
  get '/' => 'dashboards#index'
  match '/ca/:ca' => 'dashboards#ca', :as => 'ca', :constraints => { :ca => /.*/ }
end

Where is the data stored?¶ ↑

In the Rails process memory. The data goes away when the process dies.

Where is the data visible?¶ ↑

  1. Go to yourapp/action_cost, it will display a page with a list of controller action and the average number of queries made in each one of them. Click on a controller action to find which tables were queried.

  2. After each controller action completes, an action_cost summary is #{Rails.root}/log/action_cost.log