定制 oat-sa/bundle-health-check 二次开发

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

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

oat-sa/bundle-health-check

最新稳定版本:2.3.2

Composer 安装命令:

composer require oat-sa/bundle-health-check

包简介

Health Check Bundle

README 文档

README

Latest Version License GPL2 Build Status Coverage Status Packagist Downloads

Symfony bundle for health checks automation, based on health check library

Table of Contents

Installation

$ composer require oat-sa/bundle-health-check

Note: the related flex recipe will enable and auto configure the bundle in your application.

Usage

Available endpoints

This bundle provides by default the following endpoints:

Method Route Description
GET /ping ensures your application is up and running (no logic)
GET /health-check runs registered checkers (custom logic)

Notes:

  • you can check the related openapi documentation for more details
  • you can update / disable those routes in the config/routes/health_check.yaml file of your application (created by flex recipe)

Ping

The ping endpoint just returns a 200 response with the string pong as body.

It is just here to ensure your application is correctly installed, up and running.

Health Checker

This bundle will automatically add the tag health_check.checker to your application services if they implement the CheckerInterface (they will be auto registered onto the HealthChecker service).

If you want to register a CheckerInterface implementation from 3rd party libraries, you can configure them as following:

# config/services.yaml

services:
    My\Bundle\Checker\SomeChecker:
        tags:
            - { name: 'health_check.checker', priority: 2 }

    My\Bundle\Checker\OtherChecker:
        tags:
            - { name: 'health_check.checker', priority: 1 }

Note: you can use the priority property of the health_check.checker tag to order them.

Available command

If you prefer to run your checks in CLI mode, this bundle provides by default the following command:

$ bin/console health:check

Notes:

  • it runs registered checkers as explained in section above
  • it returns 0 in case of overall success, or 1 if one (or more than one) checker failed
  • it displays a summary of all executed checkers and their result

Tests

To run provided tests:

$ vendor/bin/phpunit

Note: see phpunit file for available suites.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 39
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-only
  • 更新时间: 2020-06-25