Skip to content

jasondoc3/sql_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails SQL Query Tracker

sql_tracker tracks SQL queries by subscribing to Rails' sql.active_record event notifications.

It then aggregates and generates report to give you insights about all the sql queries happened in your Rails application.

Installation

Add this line to your application's Gemfile:

group :development, :test do
  ... ...
  gem 'sql_tracker'
end

And then execute:

$ bundle

Tracking

To start tracking, simply start your rails application server. When your server is shutting down, sql_tracker will dump all the tracking data into one or more json file(s) under the tmp folder of your application.

sql_tracker can also track sql queries when running rails tests (e.g. your controller or integration tests), it will dump the data after all the tests are finished.

Reporting

To generate report, run

sql_tracker tmp/sql_tracker-*.json

License

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

About

Rails SQL Query Tracker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 99.2%
  • Shell 0.8%