Git Product home page Git Product logo

action_cost's Introduction

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

action_cost's People

Contributors

plerohellec avatar zamith avatar hectorvs avatar seratoscratch avatar

Watchers

James Cloos avatar Denisse Wehner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.