Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Enhances the Rails log entry by adding the number of DB requests made and rows returned during the current request.
Ruby
tree: d267ee0cba

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/nine_astronauts
tasks
test
MIT-LICENSE
README
Rakefile
init.rb

README

DatabaseCounters
================

Adds two database counters to the log for a request:

 - total number of requests that were made
 - total number of rows that were returned


Example
=======

Enabling in a Controller:

    class ApplicationController < ActionController::Base
        database_counters :on
        # ...
    end

Will result in log output like so:

    Completed in 847ms (View: 0, DB: 5 Calls: 92 Rows: 671) | 200 OK [http://localhost/]

Or, in older (< 2.2) versions of Rails:

    Completed in 0.05835 (17 reqs/sec) | Rendering: 0.00007 (0%) | DB: 0.00265 (4%) Calls: 5 Rows: 6 | 200 OK [http://localhost/]


Support
=======

See <http://9astronauts.com/code/database_counters/>


Copyright (c) 2007-8 Nine Astronauts, released under the MIT license.
Something went wrong with that request. Please try again.