nexelity/bprof-laravel 问题修复 & 功能扩展

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

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

nexelity/bprof-laravel

Composer 安装命令:

composer require nexelity/bprof-laravel

包简介

A Laravel wrapper for the PHP bprof profiler extension

README 文档

README

Build Status codecov

Latest Stable Version Total Downloads License

📚 Description

A Laravel wrapper package for the BProf PHP profiler.

Uncover bottlenecks, memory hogs, and performance insights in your Laravel PHP code with BProf! A heavy adaptation of the renowned XHProf library, fine-tuned for modern PHP applications.

🌟 Features

  • 🔍 Detailed function-level insights
  • 📈 Real-time application performance monitoring
  • 📊 Easy-to-visualize data
  • ⚙️ Easy integration
  • 🚀 Speed up your PHP applications!

⚙️ Pre-requisites

  1. PHP >=8.0 and ext-zlib extension enabled.
  2. Laravel >=8.40
  3. Linux or macOS (Windows is not supported)
  4. bprof-ext php extension installed. See here.
  5. bprof-viewer installed and running. See here.
  6. Eloquent compatible database (MySQL, PostgreSQL, SQLite, SQL Server)

🚀 Installation

  1. Install the wrapper
composer require nexelity/bprof-laravel
  1. Publish the config file
php artisan vendor:publish --provider="Nexelity\Bprof\BprofLaravelServiceProvider"
  1. Add the following to your .env file and modify as needed
BPROF_ENABLED=true
BPROF_VIEWER_URL=http://localhost:8080
BPROF_SERVER_NAME=My App
BPROF_DB_CONNECTION=mysql
BPROF_DB_TABLE=bprof_traces
  1. Run migrations, this will create the traces table.
php artisan migrate
  1. Clear config cache
php artisan config:clear
  1. Add the middleware to your app/Http/Kernel.php
protected $middleware = [
    ...
    \Nexelity\Bprof\Http\Middleware\BprofMiddleware::class,
];
  1. Start profiling!

🖥️ Artisan commands

# Truncate the traces table
php artisan bprof:truncate

# Trim traces older than X hours
php artisan bprof:trim {ageInHours}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-01-10