1. Go to this page and download the library: Download phpsoftbox/profiler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpsoftbox / profiler example snippets
use PhpSoftBox\Profiler\Profiler;
use PhpSoftBox\Profiler\ProfilerRegistry;
use PhpSoftBox\Profiler\Store\FileProfilerStore;
$registry = new ProfilerRegistry();
$profiler = new Profiler(
enabled: true,
store: new FileProfilerStore(__DIR__ . '/local/profiler'),
registry: $registry,
);
$profiler->startTrace('http.request', 'http');
$profiler->span('shipment.sort', function () {
// измеряемый участок
}, tags: ['shipment_id' => 123]);
$trace = $profiler->finishTrace();
$registry = new ProfilerRegistry();
foreach ($extensions as $extension) {
$extension->register($registry);
}