阅读(2844) (7)

Laravel 8 指标

2021-07-09 11:44:39 更新

Horizon 有一个指标控制面板,它提供了任务和队列的等待时间和吞吐量等信息。要让这些信息显示在这个控制面板上,你应该配置 Horizon 的 snapshot Artisan 命令,通过你的应用程序的 调度器 每五分钟运行一次:

/**
 * 定义应用程序的命令调度
 *
 * @param  IlluminateConsoleSchedulingSchedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command('horizon:snapshot')->everyFiveMinutes();
}