Sha256: 7d8cc2a4060ab647f6553a2d4d08a2aa201ff28b84f48a982660670189598710

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

= Query Diet

Query Diet counts the number of database queries for the last request and *subtly* displays it in the upper right corner of your screen.
The display turns red if too many queries are run, or if they take too long.
This is useful to prevent {N + 1 queries}[http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations] from creeping into your code.

== Installation

Install the gem with
    sudo gem install query_diet

There is no further setup necessary after you add the <tt>query_diet</tt> dependency to your Rails application.

We recommend you only use the gem with the development environment.

== Changing warning thresholds

You can define when the counter turns into a red warning. The default threshold is 8 queries and 5000 miliseconds.
To change the default, add the following to <tt>config/initializers/query_diet.rb</tt>:

    if defined?(QueryDiet)
      QueryDiet::Logger.bad_count = 8
      QueryDiet::Logger.bad_time = 5000
    end

== Rails 3 compatibility

We cannot guarantee Rails 3 compatibility at this point, but we will upgrade the gem when Rails 3 is released.

=== Credits

Henning Koch

{www.makandra.de}[http://www.makandra.de/]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
query_diet-0.2.0 README.rdoc