Download the PHP package rokde/laravel-query-analyzer without Composer
On this page you can find all versions of the php package rokde/laravel-query-analyzer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rokde/laravel-query-analyzer
More information about rokde/laravel-query-analyzer
Files in rokde/laravel-query-analyzer
Package laravel-query-analyzer
Short Description Query Analyzer for Laravel
License MIT
Informations about the package laravel-query-analyzer
Query Analyzer for Laravel
Quickstart
Add to providers
in config/app.php
:
Installation
Add to your composer.json following lines
"require": {
"rokde/laravel-query-analyzer": "~0.0"
}
Add Rokde\LaravelQueryAnalyzer\LaravelQueryAnalyzerProvider::class,
to providers
in config/app.php
.
Run php artisan vendor:publish --provider="Rokde\LaravelQueryAnalyzer\LaravelQueryAnalyzerProvider"
Configuration
enabled
Is the analyzing enabled or not.
Usage
You have a console command to get all queries listed.
List all queries
$> php artisan analyze:queries
Lists all queries. You have --limit
and --offset
as options for paginate through all the queries.
Example output:
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.
Example output:
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.
Clear the data
$> php artisan analyze:clear
Clears the whole data for analysis.
All versions of laravel-query-analyzer with dependencies
illuminate/support Version 5.2.*
illuminate/database Version 5.2.*
illuminate/cache Version 5.2.*
illuminate/console Version 5.2.*