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.
- 🔍 Detailed function-level insights
- 📈 Real-time application performance monitoring
- 📊 Easy-to-visualize data
- ⚙️ Easy integration
- 🚀 Speed up your PHP applications!
- PHP
>=8.0
andext-zlib
extension enabled. - Laravel
>=8.40
- Linux or macOS (Windows is not supported)
bprof-ext
php extension installed. See here.bprof-viewer
installed and running. See here.- Eloquent compatible database (MySQL, PostgreSQL, SQLite, SQL Server)
- 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!
# Truncate the traces table
php artisan bprof:truncate
# Trim traces older than X hours
php artisan bprof:trim {ageInHours}