0.0
No commit activity in last 3 years
No release in over 3 years
An overview of the number of queries is output to the log and browser console.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
>= 12.3.3
~> 3.0

Runtime

>= 5.2.0
 Project Readme

Queries Watch

An overview of the number of queries is output to the log and browser console.

log/development.log:

Queries total_count: 5, cached_count: 0, exec_count: 5, total_duration: 4.4ms

Browser console:

Image from Gyazo

Usage

In app/views/layout/application.html.haml:

!!!
%html
  %head
    %title MyAPP
    = favicon_link_tag '/favicon.ico'
  %body
    = yield
    - if Rails.env.development?
      = queries_watch_summary

Installation

Add this line to your application's Gemfile:

gem 'queries_watch', group: 'development'

And then execute:

$ bundle

Configuration

In config/initializers/queries_watch.rb, you can configure the following values.

if Rails.env.development?
  QueriesWatch.configure do |config|
    config.warn_threshold = 30 # default: nil
    config.error_threshold = 100  # default: nil
  end
end

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the QueriesWatch project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.