2017 © Pedro Peláez
 

library laravel-query-analyzer

Query Analyzer for Laravel

image

rokde/laravel-query-analyzer

Query Analyzer for Laravel

  • Tuesday, June 28, 2016
  • by rokde
  • Repository
  • 1 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Query Analyzer for Laravel

Latest Stable Version Latest Unstable Version License Total Downloads, (*1)

Quickstart

composer require rokde/laravel-query-analyzer

Add to providers in config/app.php:, (*2)

Rokde\LaravelQueryAnalyzer\LaravelQueryAnalyzerProvider::class,

Installation

Add to your composer.json following lines, (*3)

"require": {
    "rokde/laravel-query-analyzer": "~0.0"
}

Add Rokde\LaravelQueryAnalyzer\LaravelQueryAnalyzerProvider::class, to providers in config/app.php., (*4)

Run php artisan vendor:publish --provider="Rokde\LaravelQueryAnalyzer\LaravelQueryAnalyzerProvider", (*5)

Configuration

enabled

Is the analyzing enabled or not., (*6)

Usage

You have a console command to get all queries listed., (*7)

List all queries

$> php artisan analyze:queries

Lists all queries. You have --limit and --offset as options for paginate through all the queries., (*8)

Example output:, (*9)

01 select * from `users` where `users`.`id` = ? limit 1
02 select * from `profiles` where `profiles`.`user_id` = ? and `profiles`.`user_id` is not null

List details of one query

$> php artisan analyze:queries 1

Lists details for query number 1., (*10)

Example output:, (*11)

select * from `users` where `users`.`id` = ? limit 1
+-------+---------+---------+------+------+
| count | fastest | slowest | avg  | mode |
+-------+---------+---------+------+------+
| 14    | 0.4     | 0.73    | 0.53 | 0.58 |
+-------+---------+---------+------+------+

+----------+---------+---------+------+------+
| bindings | fastest | slowest | avg  | mode |
+----------+---------+---------+------+------+
| [1]      | 0.4     | 0.73    | 0.53 | 0.58 |
| [2]      | 0.41    | 0.74    | 0.54 | 0.59 |
+----------+---------+---------+------+------+

You can see the summary of all queries combined and afterwards the bindings-dependent timings. Maybe some bindings cause an extra long run., (*12)

Clear the data

$> php artisan analyze:clear

Clears the whole data for analysis., (*13)

The Versions

28/06 2016

dev-master

9999999-dev

Query Analyzer for Laravel

  Sources   Download

MIT

The Requires

 

by Robert Kummer

28/06 2016

0.0.1

0.0.1.0

Query Analyzer for Laravel

  Sources   Download

MIT

The Requires

 

by Robert Kummer