定制 prevplan/laravel-heartbeat-status 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prevplan/laravel-heartbeat-status

最新稳定版本:v1.0.1

Composer 安装命令:

composer require prevplan/laravel-heartbeat-status

包简介

Monitor Laravel queue and schedule status

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A simple package to monitor the queue heartbeat and the schedule of a Laravel Site.
It provides a route with a status and a 200 or 503 HTTP state that can be monitored by uptime services such as upptime.

Tested with Laravel 9 + 10.

Installation

You can install the package via composer:

composer require prevplan/laravel-heartbeat-status

The standard URL is yoursite.com/heartbeat. If you want to change this, add

Route::heartbeat_status('new-folder');

to your routes/web.php.

You can optionally publish the config file with:

php artisan vendor:publish --tag="laravel-heartbeat-status-config"

This is the contents of the published config file:

return [
    /*
    |--------------------------------------------------------------------------
    | Heartbeat Interval Time
    |--------------------------------------------------------------------------
    |
    | Time in minutes between queued heartbeatStatusCommand jobs.
    |
    */
    'heart-rate' => env('HEARTBEAT_HEART_RATE', 2),

    /*
    |--------------------------------------------------------------------------
    | Heartbeat Emergency Time
    |--------------------------------------------------------------------------
    |
    | Time in minutes to report failure/change to status 503, if the
    | last heartbeatStatusCommand is older than this value
    |
    */
    'emergency_time' => env('HEARTBEAT_EMERGENCY', 5),

    /*
    |--------------------------------------------------------------------------
    | Schedule Leeway
    |--------------------------------------------------------------------------
    |
    | Time for schedule running tolerance in seconds
    |
    */
    'schedule_leeway' => env('HEARTBEAT_SCHEDULE_LEEWAY', 10),

    /*
    |--------------------------------------------------------------------------
    | Queue Leeway
    |--------------------------------------------------------------------------
    |
    | Time for queue running tolerance in seconds
    |
    */
    'queue_leeway' => env('HEARTBEAT_QUEUE_LEEWAY', 20),
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-heartbeat-status-views"

Usage

The status page is automatically published under yoursite.com/heartbeat or another URL if you’ve changed it.
It checks the last run of the schedule and the queue.

If everything works fine, it responds to a 200 HTTP state. If there is a problem a 503 HTTP state will be shown.
You can monitor this heartbeat page with upptime or another uptime service of your choice.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 11.52k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固