maantje / pulse-php-fpm
一个用于显示 php-fpm 状态的 Laravel Pulse 卡片
v0.2.1
2023-12-10 19:26 UTC
Requires
- php: ^8.1
- adoy/fastcgi-client: ^1.0
- illuminate/support: *
- laravel/pulse: ^1.0.0@beta
Requires (Dev)
- mockery/mockery: ^1.5.0
- orchestra/testbench: ^8
- phpunit/phpunit: ^10
README
使用此方便的 Laravel Pulse 卡片,实时洞察您的 PHP FPM 状态。
示例
安装
使用 Composer 安装该包
composer require maantje/pulse-php-fpm
启用 PHP FPM 状态路径
在您的 FPM 配置中配置 PHP FPM 状态路径
pm.status_path = /status
注册记录器
在您的 pulse.php
配置文件中,使用所需的设置注册 PhpFpmRecorder
return [ // ... 'recorders' => [ \Maantje\Pulse\PhpFpm\Recorders\PhpFpmRecorder::class => [ // Optionally set a server name gethostname() is the default 'server_name' => env('PULSE_SERVER_NAME', gethostname()), // Optionally set a status path the current value is the default 'status_path' => 'localhost:9000/status', // with unix socket unix:/var/run/php-fpm/web.sock/status // Optionally give datasets, these are the default values. // Omitting a dataset or setting the value to false will remove the line from the chart // You can also set a color as value that will be used in the chart 'datasets' => [ 'active processes' => '#9333ea', 'total processes' => 'rgba(147,51,234,0.5)', 'idle processes' => '#eab308', 'listen queue' => '#e11d48', ], ], ] ]
确保您正在运行 pulse:check
命令。
添加到仪表板
通过 发布供应商视图 将卡片集成到 Pulse 仪表板中,然后修改 dashboard.blade.php
文件
<x-pulse>
<livewire:pulse.servers cols="full" />
+ <livewire:fpm cols="full" />
<livewire:pulse.usage cols="4" rows="2" />
<livewire:pulse.queues cols="4" />
<livewire:pulse.cache cols="4" />
<livewire:pulse.slow-queries cols="8" />
<livewire:pulse.exceptions cols="6" />
<livewire:pulse.slow-requests cols="6" />
<livewire:pulse.slow-jobs cols="6" />
<livewire:pulse.slow-outgoing-requests cols="6" />
</x-pulse>
就这样!在您的 Pulse 仪表板上享受对 PHP FPM 状态的增强可见性。