Revision: Fri, 17 May 2024 13:03:33 GMT
v1.0 – outdated
This version of the documentation is outdated. Consider upgrading your project to Spiral Framework 3.12
Edit this page

Profiler Panel

The Skeleton spiral application ships with spiral/profiler module to help you profile and debug internal flow of your application.

Enable/Disable Profiler panel

Profiler module can be enable and disabled by simply booting ProfilerBootloader at beginning of your application. By default, such boot will only happen in DEBUG mode defined by the enviroment:

php
/**
 * Application core bootloading, you can configure your environment here.
 */
protected function bootstrap()
{
    env('DEBUG') && $this->enableDebugging();
}

/**
 * Debug packages.
 */
private function enableDebugging()
{
    //Initiating all needed binding (no need to use memory caching)
    $this->getBootloader()->bootload([
        \Spiral\Profiler\ProfilerBootloader::class,
        \Spiral\Snapshotter\Bootloaders\FileSnapshotterBootloader::class
    ]);
}

This code is located in your App class.

Once booted profiler will create floating panel at bottom right of your screen:

Profiler Panel

Environment Overview

First profiler panel will show what classes, extensions being loaded. Indicate container bindings, http routes and ect.

Environment

Request/Response Data

View incoming request and response data on second tab.

Variables

Please note, the currently profiler indicates state of response before it's being processed by application middlewares.

Timeline

Profiler is able to indicate your application timeline using BenchmarkerInterface as source of data:

Benchmarks

Read about benchmarker here.

Logging

Every use of LoggerTrait or logger created via LogsInterface (including global LoggerInterface instance) will be captured on this tab:

Logging

Performance Notes

Please note that profiler is executed in a same process as your application, keeping profiler enabled will slow down your application a lot.

Consider alternative profiling techniques like xDebug or Blackfire(https://blackfire.io/).