• PHP拓展


    Windows安装

    参考:https://www.cnblogs.com/buexplain/p/4821619.html

    dll文件下载:https://windows.php.net/downloads/pecl/releases/xhprof/0.10.6/

    第一步:下载dll,放到php的ext目录下

    第二步:配置php.ini,加入如下两行。是否成功,可查看phpinfo

    [xhprof]
    extension=xhprof.dll
    ; 日志配置目录
    xhprof.output_dir="E:/logs/xhprof/xhprof_log"

    第三步:测试包文件

    下载路径:http://pecl.php.net/package/xhprof

    解压到www目录,访问测试文件D:/www/xhprof-0.9.4examplessample.php

    性能检测主要代码如下

            // 开始监测
            xhprof_enable();
    
           //监测的详细代码写在这里
           ..................................
           ..................................
    
            // 结束监测
            $xhprof_data = xhprof_disable();
            $XHPROF_ROOT = realpath(dirname(__FILE__) .'/../../../xhprof-0.9.4/xhprof-0.9.4');
            include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
            include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
            $xhprof_runs = new XHProfRuns_Default();
            $id = $xhprof_runs->save_run($xhprof_data, "xhprof_foo"); //生成日志的编号

    然后访问你需要分析的代码就可以得到一个日志文件。E:logsxhprofxhprof_log55fd13b01475f.xhprof_yii.xhprof

    注意目录应该先建立好:E:logsxhprofxhprof_log

    效果如图:

    第四步:查看日志

    访问本地域名:http://localhost/xhprof-0.9.4/xhprof-0.9.4/xhprof_html/ 

    具体路径根据个人设置为准

    效果如图,可以查看生成的日志记录和详细的性能日志

  • 相关阅读:
    memory prefix out omni,over,out,od,octa ~O
    killl prefix out macro mis mal micro -m
    memory prefix mini mono multi out _m 5
    memory prefix inter,intra,intro,iso out 5
    memory prefix il ir im in out 3 i
    memory prefix twi,tri,trans ,tetra out 4
    memory prefix retro,re out 2
    memory prefix un,under,uni out1
    Python调用libsvm
    yolov3 训练数据集
  • 原文地址:https://www.cnblogs.com/qq917937712/p/8889001.html
Copyright © 2020-2023  润新知