0.0
No commit activity in last 3 years
No release in over 3 years
Supplementary Gem to sql_tracker allowing you to compare query data bewteen files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

= 0.7.0
= 2.2.0
= 0.10.0
 Project Readme

What this is?

This is a gem that can be used for comparing sql_tracker reports for different branches.

Setup

Simply run the following in terminal while in the repo directory (temporary solution while not in rubygems.org)

gem build sql_reporter.gemspec
gem install sql_reporter

or if you are using Bundler

bundle

Usage

sql_reporter original_branch.json improved_branch.json

The above will generate a comparison.log file with content akin to:

SQL Count Decreases between samples/master.json -> samples/637.json
##########################################################

Queries killed: 0

Duration decrease[ms]: 0.0

SQL Count Increases between samples/master.json -> samples/637.json
##########################################################

Queries killed: 0

Duration decrease[ms]: 0.0

SQL Spawned between samples/master.json -> samples/637.json
##########################################################
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+-------------------------------------+
|Query                                                                                                                                                                                                                                 |Count difference             |Duration difference [ms]             |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+-------------------------------------+
|SELECT `apples`.* FROM `apples` WHERE `apples`.`apple_id` = xxx AND `apples`.`locale` = xxx AND `appler`.`apple_type` IN (xxx)             |0 -> 1                       |0.0 -> 1.76                          |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+-------------------------------------+
Queries spawned: 1

Duration gain[ms]: 1.76

SQL Gone between samples/master.json -> samples/637.json
##########################################################
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------------------+
|Query                                                                                                                                                                                                                                                                   |Count diff… |Duration differenc… |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------------------+
|SELECT `apples`.* FROM `apples` WHERE `apples`.`apple_id` = xxx AND `apples`.`apple_type` = xxx AND `apples`.`locale` = xxx ORDER BY `email_default_messages`.`id` ASC LIMI… |7 -> 0      |13.78 -> 0.0        |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------------------+
Queries killed: 7

Duration decrease[ms]: 13.78

################## SUMMARY #####################

Queries killed: 6

Duration decrease[ms]: 12.02