aeatech/web-snapshot-profiler-xhprof-bundle 问题修复 & 功能扩展

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

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

aeatech/web-snapshot-profiler-xhprof-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require aeatech/web-snapshot-profiler-xhprof-bundle

包简介

Web snapshot profiler xhprof bundle for symfony (production ready)

README 文档

README

Code Coverage

The package contains symfony bundle to profile web applications with xhprof. It can be used for production profiling.

System requirements:

Installation (Composer):

composer require aeatech/web-snapshot-profiler-xhprof-bundle

Auto installation

You can install it with custom recipe.

composer config extra.symfony.allow-contrib true
composer config --json --merge extra.symfony.endpoint '["https://api.github.com/repos/AEATech/recipes/contents/index.json?ref=main", "flex://defaults"]'
composer require aeatech/web-snapshot-profiler-xhprof-bundle

Manual installation

Enable bundle in dev and prod env.

// config/bundles.php

return [
    // ...
    AEATech\WebSnapshotProfilerXhprofBundle\AEATechWebSnapshotProfilerXhprofBundle::class => ['dev' => true, 'prod' => true],
    // ...
];

Configuration

Symfony Flex generates a default configuration in config/packages/aea_tech_web_snapshot_profiler_xhprof.yaml

aea_tech_web_snapshot_profiler_xhprof:
    # Enable/Disable profiling
    is_profiling_enabled: false

    # Application info for snapshot naming
    app_version: '0.0.1'

    # XHGUI configuration
    xhgui:
        import_uri: '%env(string:AEA_TECH_WEB_SNAPSHOT_PROFILER_XHPROF_XHGUI)%'
        import_timeout: 1

    ###
    # xhprof configuration
    # - collect internal functions info
    # - collect memory allocation info
    ###
    xhprof:
        collect_additional_info: '1'
        flags:
            - !php/const Xhgui\Profiler\ProfilingFlags::MEMORY

    ###
    # Event matched configuration - START
    ###
    event_matcher:
        # Enable/Disable all routes profiling
        is_profile_all_routes: false

        # Enable profile if header was set (\AEATech\WebSnapshotProfilerEventSubscriber\EventMatcher\HeaderEventMatcher)
        header:
            is_enabled: false
            name: 'x-profiling-header'
            value: '1'

        # Enable profile if request param was set and route matched (\AEATech\WebSnapshotProfilerEventSubscriber\EventMatcher\RequestParamAwareRouteEventMatcher)
        request:
            is_enabled: false
            name: 'x-profile-request-param'
            route_to_probability:
                # 1% probability to profile route
                -
                    route_name: 'app_route_name_1'
                    probability: 1
                # 100% probability to profile route
                -
                    route_name: 'app_route_name_2'
                    probability: 100

        # Enabled profile if route matched and probability happened
        route:
            is_enabled: false
            route_to_probability:
                # 1% probability to profile route
                -
                    route_name: 'app_route_name_1'
                    probability: 1
                # 100% probability to profile route
                -
                    route_name: 'app_route_name_2'
                    probability: 100
    ###
    # Event matched configuration - END
    ###

License

MIT License. See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固