PHPackages                             tinywan/webman-xhprof - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. tinywan/webman-xhprof

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

tinywan/webman-xhprof
=====================

Webman plugin tinywan/webman-xhprof

v1.0.0(2y ago)13110MITPHPPHP &gt;=7.2

Since Jun 2Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Tinywan/webman-xhprof)[ Packagist](https://packagist.org/packages/tinywan/webman-xhprof)[ RSS](/packages/tinywan-webman-xhprof/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

XHProf PHP tool for webman plugin
=================================

[](#xhprof-php-tool-for-webman-plugin)

[![Latest Stable Version](https://camo.githubusercontent.com/9f4fb1775666c515eeb3118d616b5c17d3966b263fc0c1f5252cb09df329bf0b/687474703a2f2f706f7365722e707567782e6f72672f74696e7977616e2f7765626d616e2d786870726f662f76)](https://packagist.org/packages/tinywan/webman-xhprof) [![Total Downloads](https://camo.githubusercontent.com/49c22d8cad0e6b31c4550f828ce222fc6f34882e5e03957119c9eebeac4cb630/687474703a2f2f706f7365722e707567782e6f72672f74696e7977616e2f7765626d616e2d786870726f662f646f776e6c6f616473)](https://packagist.org/packages/tinywan/webman-xhprof) [![Latest Unstable Version](https://camo.githubusercontent.com/f93ec85f9f9972424658b00f92dd8986a993752ef0e42d3d9e2cca7f6fef7036/687474703a2f2f706f7365722e707567782e6f72672f74696e7977616e2f7765626d616e2d786870726f662f762f756e737461626c65)](https://packagist.org/packages/tinywan/webman-xhprof) [![License](https://camo.githubusercontent.com/e666ea8238d0b0733796587847a4154655ec4fb85651b1a0aa71557acde12cf4/687474703a2f2f706f7365722e707567782e6f72672f74696e7977616e2f7765626d616e2d786870726f662f6c6963656e7365)](https://packagist.org/packages/tinywan/webman-xhprof) [![PHP Version Require](https://camo.githubusercontent.com/da493f686821116d4425ac6d4ca648c945ea33724dcd52dc929bcc676ebfc291/687474703a2f2f706f7365722e707567782e6f72672f74696e7977616e2f7765626d616e2d786870726f662f726571756972652f706870)](https://packagist.org/packages/tinywan/webman-xhprof)

简介
==

[](#简介)

[XHProf](https://www.php.net/manual/zh/intro.xhprof.php) 是一个分层PHP性能分析工具。它报告函数级别的请求次数和各种指标，包括阻塞时间，CPU时间和内存使用情况。一个函数的开销，可细分成调用者和被调用者的开销，XHProf数据收集阶段，它记录调用次数的追踪和包容性的指标弧在动态callgraph的一个程序。它独有的数据计算的报告/后处理阶段。

在数据收集时，XHProfd通过检测循环来处理递归的函数调用，并通过给递归调用中每个深度的调用一个有用的命名来避开死循环。XHProf分析报告有助于理解被执行的代码的结构，它有一个简单的HTML的用户界面（ PHP写成的）。基于浏览器的性能分析用户界面能更容易查看，或是与同行们分享成果。也能绘制调用关系图。

安装
==

[](#安装)

```
composer require tinywan/webman-xhprof
```

[XHProf](https://www.php.net/manual/zh/intro.xhprof.php) 安装
===========================================================

[](#xhprof-安装)

下载

```
wget https://pecl.php.net/get/xhprof-2.3.9.tgz
tar -zxvf xhprof-2.3.9.tgz
cd ./xhprof-2.3.9/extension
phpize
./configure --with-php-config=/usr/local/php-7.4/bin/php-config
make
make install
```

`php.ini` 配置

```
[xhprof]
extension=xhprof.so;
xhprof.output_dir=/tmp/xhprof;
```

确认是否安装成功

```
/var/www # php --ri xhprof

xhprof

xhprof support => enabled
Version => 2.3.9
```

使用
==

[](#使用)

配置 `config/middleware.php`

```
return [
    '' => [
        \Tinywan\Xhprof\XhprofMiddleware::class,
    ]
];
```

查看
==

[](#查看)

访问地址 `http://webman.xhprof.com/xhprof/xhprof_html/index.php`

> Existing runs

[![displaying_top.png](./displaying_top.png)](./displaying_top.png)

> Webman\\App::Webman{closure}

[![Webman\App::Webman{closure}](./webman.png)](./webman.png)

> 图形化展示

[![图形化展示](./webman-gpl.png)](./webman-gpl.png)

其他
==

[](#其他)

```
Function Name：方法名称。
Calls：方法被调用的次数。
Calls%：方法调用次数在同级方法总数调用次数中所占的百分比。
Incl.Wall Time(microsec)：方法执行花费的时间，包括子方法的执行时间。（单位：微秒）
IWall%：方法执行花费的时间百分比。
Excl. Wall Time(microsec)：方法本身执行花费的时间，不包括子方法的执行时间。（单位：微秒）
EWall%：方法本身执行花费的时间百分比。
Incl. CPU(microsecs)：方法执行花费的CPU时间，包括子方法的执行时间。（单位：微秒）
ICpu%：方法执行花费的CPU时间百分比。
Excl. CPU(microsec)：方法本身执行花费的CPU时间，不包括子方法的执行时间。（单位：微秒）
ECPU%：方法本身执行花费的CPU时间百分比。
Incl.MemUse(bytes)：方法执行占用的内存，包括子方法执行占用的内存。（单位：字节）
IMemUse%：方法执行占用的内存百分比。
Excl.MemUse(bytes)：方法本身执行占用的内存，不包括子方法执行占用的内存。（单位：字节）
EMemUse%：方法本身执行占用的内存百分比。
Incl.PeakMemUse(bytes)：Incl.MemUse峰值。（单位：字节）
IPeakMemUse%：Incl.MemUse峰值百分比。
Excl.PeakMemUse(bytes)：Excl.MemUse峰值。单位：（字节）
EPeakMemUse%：Excl.MemUse峰值百分比。
```

xhprof 简单代理配置
-------------

[](#xhprof-简单代理配置)

```
server {
    server_name webman.xhprof.com;

    root /var/www/webman-admin/vendor/tinywan/webman-xhprof/src;

    location / {
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?s=/$1 last;
        }
    }

    location ~ \.php(.*)$ {
        try_files $fastcgi_script_name =404;

        fastcgi_pass php74:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

        include fastcgi_params;
    }
}

```

访问地址：`http://webman.xhprof.com/xhprof/xhprof_html/index.php`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1079d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0042e0b68ff6a731ef382a03eecd211736c2d619acc55b2b326988085f72bfb?d=identicon)[Tinywan](/maintainers/Tinywan)

---

Top Contributors

[![Tinywan](https://avatars.githubusercontent.com/u/14959876?v=4)](https://github.com/Tinywan "Tinywan (6 commits)")

---

Tags

composerphp7tinywanwebmanwebman-frameworkworkermanxhprof

### Embed Badge

![Health badge](/badges/tinywan-webman-xhprof/health.svg)

```
[![Health](https://phpackages.com/badges/tinywan-webman-xhprof/health.svg)](https://phpackages.com/packages/tinywan-webman-xhprof)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
