aaron-dev/xhprof-webman 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aaron-dev/xhprof-webman

最新稳定版本:v2.0.4

Composer 安装命令:

composer require aaron-dev/xhprof-webman

包简介

aaron-dev/xhprof-webman is a code performance analysis plugin that is compatible with webman. Mainly optimize and adjust the old and unusable xhprof for adapting to webman, making installation simple and fast.Developers can quickly access performance analysis reports through browsers to troubleshoot

README 文档

README

aaron-dev/xhprof-webman是一款适配webman的代码性能分析插件。 主要对旧版且无法使用的xhprof做优化调整,用于适配webman,安装简单快捷。 开发者可以通过浏览器快速访问性能分析报告,排查代码性能问题。

作者博客

艾瑞可erik

安装

php要安装xhprof扩展 在php.ini中增加配置

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

Use Composer:

composer require aaron-dev/xhprof-webman

配置

  1. config增加全局中间件
    '' => [
        Aaron\Xhprof\Webman\XhprofMiddleware::class,
    ]
  1. 创建控制器,复制下面代码
<?php

namespace app\controller;

use support\Request;
use Aaron\Xhprof\Webman\Xhprof;

class TestController
{
    public function index(Request $request)
    {
        return Xhprof::index();
    }
}

  1. 路由增加以下代码(页面入口 + 静态资源,静态资源从包内直接提供,无需复制到 public)
Route::get('/test', ['app\controller\TestController','index']);
Route::get('/xhprof-assets/{path:.+}', [\Aaron\Xhprof\Webman\StaticController::class, 'serve']);
  1. 基础配置在 config/plugin/aaron-dev/xhprof/xhprof.php 中
'enable' => true,
'time_limit' => 0,
'log_num' => 1000,
'view_wtred' => 3,
'ignore_url_arr' => ["/test"],
'assets_url' => '/xhprof-assets',  // 静态资源 URL,须与上面路由中的 path 一致
  1. 然后重启服务就可以访问了。

本插件参考phacility/xhprofphpxxb/xhprof

统计信息

  • 总下载量: 313
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固