Popularity
2.4
Growing
Activity
7.2
Declining
200
5
4

Description

Tool for finding time-consuming database queries for ActiveRecord-based Rails Apps. Provides Slack notifications for with backtrace, raw SQL, time duration, etc.

Monthly Downloads: 479
Programming language: Ruby
License: MIT License
Tags: Database Tools     Rails     Active Record    
Latest version: v0.0.8

QueryTrack alternatives and similar gems

Based on the "Database Tools" category

Do you think we are missing an alternative of QueryTrack or a related project?

Add another 'Database Tools' Gem

README

QueryTrack

Gem Version CircleCI Maintainability

Tool for finding time-consuming database queries for ActiveRecord-based Rails Apps. Provides Slack notifications with backtrace, raw SQL, time duration, etc.

Installation

Add this line to your application's Gemfile and then execute bundle install:

gem 'query_track'

Usage

SQL Duration Limit

Specify SQL duration query limit (in seconds):

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
end

Console Log

Enable console logs from config:

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
  config.logs = true
end

Filters

To avoid noisy warnings from used gems, and places where fat queries are justified, you can filters SQL by backtrace. For example, you have installed activeadmin and want to skip everything from app/admin:

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
  config.filters = ['app/admin']
end

Enable/Disable toggle

Enable/disable with ENV variables to turn it on/off without code push. By default QueryTrack is enabled.

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
  config.enabled = ENV['QUERY_TRACK_ENABLED']
end

Slack Notifications

To receive notifications about slow queries into Slack, you need to install incoming-webhooks and put link into config file:

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
  config.notifications.slack = 'https://hooks.slack.com/services/T0000000/B0000000/C0000000'
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/query_track.

License

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


*Note that all licence references and agreements mentioned in the QueryTrack README section above are relevant to that project's source code only.