Find Time-Consuming ActiveRecord Database Queries with QueryTrack

A tool for monitoring SQL queries in Rails

Get notified about slow queries

Installation

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

Configuration

SQL Duration Limit (Time Limits)

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

Filters

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

Enable/Disable without code change

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

Console Log

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

Slack Notifications

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

Conclusion

Software Engineer. Interested in Full-Stack Development and DevOps.

Software Engineer. Interested in Full-Stack Development and DevOps.