PHP code example of aaron-dev / xhprof-laravel

1. Go to this page and download the library: Download aaron-dev/xhprof-laravel 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/ */

    

aaron-dev / xhprof-laravel example snippets


  php artisan vendor:publish --provider="Aaron\Xhprof\XhprofServiceProvider"

 


'enable' => true,
'time_limit' => 0,  //仅记录响应超过多少秒的请求  默认0记录所有
'log_num' => 1000, //仅记录最近的多少次请求(最大值有待观察,看日志、查看响应时间) 默认1000
'view_wtred' => 3, //列表耗时超过多少秒标红 默认3s
'ignore_url_arr' => ["/test"],  //忽略URL配置





namespace App\Http\Controllers;
use Aaron\Xhprof\Xhprof;

class IndexController extends Controller{


    public function index(){
        return Xhprof::index();
    }
}