定制 gon-nl/laravel-status-endpoint 二次开发

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

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

gon-nl/laravel-status-endpoint

最新稳定版本:1.0.0

Composer 安装命令:

composer require gon-nl/laravel-status-endpoint

包简介

Laravel Status Endpoint is a Laravel package that adds a simple status endpoint to your application

README 文档

README

Laravel Status Endpoint is a Laravel package that adds a simple /api/status endpoint to your application, returning the current status of the database and cache.

Installation

You can install the package via composer:

composer require gon-nl/laravel-status-endpoint

After installation, the package should be auto-discovered by Laravel.

Configuration

You can publish the configuration file by running the following command:

php artisan vendor:publish --provider="GonNl\LaravelStatusEndpoint\LaravelStatusEndpointServiceProvider" --tag="config"

This will create a new laravel-status-endpoint.php file in your config directory.

Thresholds

You can configure the warning thresholds for both the database and cache checks by specifying the database.threshold and cache.threshold values in the configuration file, respectively. The default values are 200 and 100 (in milliseconds), respectively.

Usage

After installation, you can access the /api/status endpoint of your application to get the current status of the database and cache. The endpoint returns a JSON response with the following structure:

{
    "status": "OK",
    "database": 94,
    "cache": 36,
    "last_check": "2022-05-01 12:00:00",
    "last_check_human": "1 hour ago"
}

The status field indicates the overall status of the checks, which can be either OK, WARNING, or ERROR. The database and cache fields indicate the execution time (in milliseconds) of the database and cache checks, respectively. The last_check and last_check_human fields indicate the date and time of the last status check, as well as a human-readable representation of the elapsed time since the last check, respectively.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-29