spatie/laravel-health
Monitor your Laravel app’s health by registering checks (disk space, etc.) with warning/fail thresholds. Get notified via mail or Slack when checks degrade, and extend with custom checks for proactive alerting.
This check makes sure that your CPU load isn't too high.
To use this check, you must install the spatie/cpu-load-health-check package
composer require spatie/cpu-load-health-check
The package monitors the Unix CPU load numbers. By default, three numbers are available:
You can make the check fail by using on of these three functions:
failWhenLoadIsHigherInTheLastMinute($load)failWhenLoadIsHigherInTheLast5Minutes($load)failWhenLoadIsHigherInTheLast15Minutes($load)Here's how you can register the check.
use Spatie\Health\Facades\Health;
use Spatie\CpuLoadHealthCheck\CpuLoadCheck;
Health::checks([
CpuLoadCheck::new()
->failWhenLoadIsHigherInTheLast5Minutes(2.0)
->failWhenLoadIsHigherInTheLast15Minutes(1.5),
]);
How can I help you explore Laravel packages today?