Socket
Book a DemoInstallSign in
Socket

sql_reporter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql_reporter

0.10.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

What this is?

This is a gem that can be used for comparing reports generated by excellent sql_tracker gem for different branches. It can be useful for detecting SQL queries regressions or optimisation opportunities.

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

FAQs

Package last updated on 26 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.