Download the PHP package asamir/laravel-in-db-performance-monitor without Composer

On this page you can find all versions of the php package asamir/laravel-in-db-performance-monitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-in-db-performance-monitor

Laravel In DB Performance Monitor

Monitor your laravel application performance by logging requests in your database then analyze it. The log includes request parameters, actions, SQL queries and errors beside that you can know the requests with raw SQL queries. Demo

Table of contents

Requirements

Laravel >=5.1

Installation

1- Run composer require asamir/laravel-in-db-performance-monitor

2- For laravel < 5.5 add this provider in config/app.php

'providers' => [
    \\...
    ASamir\InDbPerformanceMonitor\InDbPerformanceMonitorProvider::class,
]

3- Run php artisan in-db-performance-monitor:init

4- Add and configure the inDbMonitorConn connection in config/database.php file => Hint: the package .env variables is created for you by the previous command:

'connections' => [
    //...
    'inDbMonitorConn' => [
        'driver' => 'mysql',
        'host' => env('IN_DB_MONITOR_DB_HOST', ''),
        'port' => env('IN_DB_MONITOR_DB_PORT', '3306'),
        'database' => env('IN_DB_MONITOR_DB_DB', ''),
        'username' => env('IN_DB_MONITOR_DB_USERNAME', ''),
        'password' => env('IN_DB_MONITOR_DB_PASSWORD', ''),
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => 'asamir_',
        'strict' => false,
        'engine' => null,
    ],
]

5- Add the this middleware in app/Http/Kernel.php file

protected $middleware = [
    //...
    \ASamir\InDbPerformanceMonitor\InDbPerformanceMonitorMiddleware::class
];

6- Add this line in app/Exceptions/Handler.php => public function report(Exception $exception)

public function report(Exception $exception) {
    //...
    \ASamir\InDbPerformanceMonitor\LogErrors::inDbLogError($exception);

    parent::report($exception);
}
//..Hint For laravel < 5.3 => instead of $exception it will be $e

7- Run php artisan migrate

Now you can make requests and monitor it at /admin-monitor

Remember to open config/inDbPerformanceMonitor.php to set your custom configurations

Documentation

Configurations

Routes

Hint: in the search boxes you can use the like wildcards like %%

/admin-monitor

The login page (default password = monitor)


/admin-monitor/dashboard

Dashboard with requests counts grouped by type and archive tag.


/admin-monitor/requests

List all logged requests


/admin-monitor/request/{id}

Shows the request details, queries, and error beside that it allows you to re-run the queries.

Hint => You can quickly get your last request by Latest By Session ID Or IP

By Session ID => Get last request made by your session id

By IP => Get last request made by your ip (requests made by api or routes
which don't use the web middleware will generate different session id at
every request, so you can get them by your IP).

/admin-monitor/statistics-report

Statistics report about the requests performance group by request route uri and type.


/admin-monitor/errors-report

Statistics report of requests errors group by page uri, type, and error message.


/admin-monitor/archives-report

Statistics report of requests archives.


/admin-monitor/ips-report

Statistics report of requests IPs. Also you have the ability to recalculate the uncompleted IPs Info.


/admin-monitor/change-password

To change admin monitor panel password.

Best Practices

I was working on a project and my task was to test the application performance and list the requests with performance issues. The problem was that after migrating the data and the database size became larger the application performance decreased and sometimes crashes. Instead of loop on all the application code and check every line on it, I built a listener to log the requests data (queries) run by the application then I analyzed this data and quickly found the requests with weak points. As a result of this, I built the laravel-in-db-performance-monitor package and published it to be used by anyone.

Here are some tips for best practices:


New Features and Upgrade

Hint: If you are using an older version (<v2) please run this command after upgrade

php artisan in-db-performance-monitor:init --ips=true --serialize=true

and add this lines in config/inDbPerformanceMonitor.php

'IN_DB_MONITOR_GET_IP_INFO' => env('IN_DB_MONITOR_GET_IP_INFO', true),
'IN_DB_MONITOR_GET_IP_CLASS' => '\\ASamir\\InDbPerformanceMonitor\\IPInfo',

Dummy Data => Demo (password=monitor)

Author

Ahmed Samir

Contacts: Linkedin


All versions of laravel-in-db-performance-monitor with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package asamir/laravel-in-db-performance-monitor contains the following files

Loading the files please wait ....