xhprof代码添加分析性能

<?php
xhprof_enable(
    XHPROF_FLAGS_MEMORY,
    [
        'ignored_functions'    => [
            //'call_user_func',
            //'call_user_func_array'
        ]
    ]
);


//逻辑代码
//......

$xhprofData = xhprof_disable();// $xhprofData是数组形式的分析结果

require '../xhprof_lib/utils/xhprof_lib.php';
require '../xhprof_lib/utils/xhprof_runs.php';

$xhprofRuns = new XHProfRuns_Default();
$runId = $xhprofRuns->save_run($xhprofData, 'xhprof_test');

$profile_url = 'http://10.10.20.3/xhprof_html/index.php?run=' . $runId . '&source=xhprof_test';
echo '<a href="'.$profile_url.'" target="_blank">性能链接</a>';
原文地址:https://www.cnblogs.com/dongruiha/p/6802163.html