zoukankan      html  css  js  c++  java
  • xhprof

    #官网下载
    http://pecl.php.net/package/xhprof
    tar zxf xhprof-0.9.2.tgz
     
    cd xhprof-0.9.2/extension/
     
    sudo phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config
    sudo make
    sudo make install
     
    #php.ini
    [xhprof]
    extension=xhprof.so;
    ; directory used by default implementation of the iXHProfRuns
    ; interface (namely, the XHProfRuns_Default class) for storing
    ; XHProf runs.
    ;
    ;xhprof.output_dir=<directory_for_storing_xhprof_runs>
    xhprof.output_dir=/tmp/xhprof

    php中的代码:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
    /** monitor begin */
    include 'common.php';
    $host '127.0.0.1';
    $port = 11216;
    $objMc new Memcache();
    $objMc->addServer( $host,$port,true,1,1,15,true );
    $key 'test';
    $value file_get_contents'b.js' );
    $str = md5( $value );
    dump( $str );
    $objMc->set( $key,$value ); 
    md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));
    $rs $objMc->get( $key );
    dump( md5( $rs ) );
    dump($rs) ;
    $data = xhprof_disable();
    include_once "xhprof_lib/utils/xhprof_lib.php"
    include_once "xhprof_lib/utils/xhprof_runs.php"
    $objXhprofRun new XHProfRuns_Default();
    $run_id $objXhprofRun->save_run($data'memcache');
    /** monitor end */
    dump( $run_id );
    exit;
  • 相关阅读:
    leetCode算法题(一)
    node学习笔记1(http模块)
    mySql常用命令总结
    django学习遇到的问题解决方式
    WebSSH2 界面ssh(转载)
    垃圾回收策略学习总结
    5种数组扁平化方法
    冒泡、插入、选择、归并、快速排序
    手写ES6数组方法
    HTTP options预请求
  • 原文地址:https://www.cnblogs.com/allenhaozi/p/4508407.html
Copyright © 2011-2022 走看看