承接 chris-ware/pulse-health-check 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

chris-ware/pulse-health-check

最新稳定版本:1.1.0

Composer 安装命令:

composer require chris-ware/pulse-health-check

包简介

Combine the power of Laravel Pulse with Spatie's Health Checks

README 文档

README

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

Combine the power of Laravel Pulse with Spatie's Health Checks

Installation

You can install the package via composer:

composer require chris-ware/pulse-health-check

Usage

Cache Hit Ratio Check

This check will warn or fail if the cache hit ratio hits a certain percentage threshold. By default, it will fail at 10% hit ratio and warn at 25%.

use ChrisWare\PulseHealthCheck\Checks\PulseCacheHitRatioCheck;

PulseCacheHitRatioCheck::new();

Configure the failure and warning levels:

use ChrisWare\PulseHealthCheck\Checks\PulseCacheHitRatioCheck;

PulseCacheHitRatioCheck::new()->failWhenSizeRatioBelow(25)->warnWhenSizeRatioBelow(50);

Generic Check

This generic check will accommodate most basic circumstances for Pulse aggregates. Every check must have a defined for method on it for it to understand which aggregate type to use.

Example for slow query aggregation:

use ChrisWare\PulseHealthCheck\Checks\PulseCheck;

PulseCheck::new()
    ->for('slow_query')
    ->failWhenAbove(5)
    ->warnWhenAbove(3)
    ->interval(\Carbon\CarbonInterval::minutes(5));

Example for user request aggregation:

use ChrisWare\PulseHealthCheck\Checks\PulseCheck;

PulseCheck::new()
    ->for('user_request')
    ->aggregate('count')
    ->failWhenAbove(500)
    ->warnWhenAbove(300)
    ->interval(\Carbon\CarbonInterval::minutes(5));

Available methods

for: Determine the aggregation type to use

aggregate: Determine the aggregation value to use (defaults to max)

failWhenAbove: Set the value to fail if greater than or equal to

failWhenBelow: Set the value to fail if less than or equal to

warnWhenAbove: Set the value to warn if greater than or equal to

warnWhenBelow: Set the value to warn if less than or equal to

interval: The CarbonInterval for aggregations to be evaluated (defaults to 1 hour)

Testing

composer test

Changelog

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

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

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