2017 © Pedro Peláez
 

library xhprof

MyZiyuye Xhprof library

image

myziyue/xhprof

MyZiyuye Xhprof library

  • Tuesday, June 27, 2017
  • by evan2884
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 5 % Grown

The README.md

xhprof集成类库

系统需求

  1. PHP扩展:xhprof
  2. 安装gd、graphviz、fontconfig, (*1)

    如,以centos系统为例,可以使用yum安装方式, (*2)

# yum install -y gd gd-devel fontconfig fontconfig-devel graphviz

安装方法

composer require myziyue/xhprof

使用方法

方式1:嵌入到项目中

<?php
include './vendor/autoload.php';

function foo() {
  for ($idx = 0; $idx < 5; $idx++) {
    bar($idx);
    $x = strlen("abc");
  }
}

\myziyue\xhprof\ZyXhprof::startProfiling(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);

// run program
foo();

\myziyue\xhprof\ZyXhprof::stopProfiling('demo');

方式2: 通过注册系统关闭函数

  • 1、nginx配置文件增加如下代码:
fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/vendor/myziyue/xhprof/ZyPreInject.php";
fastcgi_param PHP_VALUE "auto_append_file=/var/www/vendor/myziyue/xhprof/ZyEndInject.php";

  • 2、php.ini方式:
auto_prepend_file=/var/www/vendor/myziyue/xhprof/ZyPreInject.php;
auto_append_file=/var/www/vendor/myziyue/xhprof/ZyEndInject.php;

查看分析结果

  1. 首先,启动服务
./vendor/bin/zyxpf
  1. 然后,通过浏览器,查看分析结果
http://localhost:1105/

The Versions

27/06 2017

dev-master

9999999-dev http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

27/06 2017

1.0.7

1.0.7.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

27/06 2017

dev-develop

dev-develop http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

15/12 2016

1.0.6

1.0.6.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

14/12 2016

1.0.5

1.0.5.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

14/12 2016

1.0.4

1.0.4.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

14/12 2016

1.0.3

1.0.3.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

13/12 2016

1.0.2

1.0.2.0 http://www.myziyue.com/

MyZiyuye Xhprof library

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

12/12 2016

1.0.1

1.0.1.0 http://www.myziyue.com/

MyZiyuye Xhprof library 1.0.1

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

12/12 2016

1.0.0

1.0.0.0 http://www.myziyue.com/

MyZiyuye Xhprof library 1.0.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

12/12 2016

0.2

0.2.0.0 http://www.myziyue.com/

Xhprof 0.1

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue

12/12 2016

0.1

0.1.0.0 http://www.myziyue.com/

Xhprof 0.1

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-xhprof *

 

php xhprof myziyue