nexelity/bprof-laravel
Composer 安装命令:
composer require nexelity/bprof-laravel
包简介
A Laravel wrapper for the PHP bprof profiler extension
README 文档
README
📚 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
- PHP
>=8.0andext-zlibextension enabled. - Laravel
>=8.40 - Linux or macOS (Windows is not supported)
bprof-extphp extension installed. See here.bprof-viewerinstalled and running. See here.- Eloquent compatible database (MySQL, PostgreSQL, SQLite, SQL Server)
🚀 Installation
- Install the wrapper
composer require nexelity/bprof-laravel
- Publish the config file
php artisan vendor:publish --provider="Nexelity\Bprof\BprofLaravelServiceProvider"
- 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
- Run migrations, this will create the traces table.
php artisan migrate
- Clear config cache
php artisan config:clear
- Add the middleware to your app/Http/Kernel.php
protected $middleware = [ ... \Nexelity\Bprof\Http\Middleware\BprofMiddleware::class, ];
- 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
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2024-01-10