定制 neighborhoods/throwable-diagnostic-component 二次开发

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

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

neighborhoods/throwable-diagnostic-component

Composer 安装命令:

composer require neighborhoods/throwable-diagnostic-component

包简介

A Service Agnostic Component for diagnosing Throwables.

README 文档

README

A Service Agnostic Component for diagnosing Throwables.

The ThrowableDiagnostic can determine if a Throwable happened because of a permanent or transient fault (network issues, database down, 3rd party service unavailable).

Every Throwable is by default considered permanent, but certain Throwables are known to be transient. With custom diagnostic logic such cases can be identified.

Diagnostic logic for common cases like RDBMS and AWS are available out of the box. Defining your own diagnostic logic is straightforward.

Install

Via Composer

$ composer require neighborhoods/throwable-diagnostic-component

Versioning

Don't confuse releases on packagist, e.g. 3.0.0, with versions of components contained within this package, e.g. AwsSqsV1. One release may contain multiple versions of the same component.
Parts of your code may use older versions of components, while others use the latest.

Upgrade

For upgrading from release 3 to release 4 follow the Upgrade Guide.

Usage

Components fall into one of two categories

  • Throwable Diagnostic
  • Throwable Diagnostic Decorator

The Throwable Diagnostic defines the core concept of how this works. The Throwable Diagnostic mostly contains interfaces. It determines how user code diagnoses a Throwable, how the decorators look, and how to define the stack of decorators to be used. You may think of it as a framework/skeleton/scaffolding.
There might be multiple versions of throwable diagnostic, e.g. ThrowableDiagnosticV1 and ThrowableDiagnosticV2.

A Throwable Diagnostic Decorator is in charge of diagnosing certain Throwables. For example, the GuzzleV1 component has a decorator which decides if an exception originating from guzzle is transient or not. During the diagnostic process a Throwable can be inspected by multiple decorators, each of which may decide that the Throwable is transient, permanent, or should be passed to the next decorator. A throwable diagnostic decorator is made for a specific version of Throwable Diagnostic. All decorators compatible with ThrowableDiagnosticV1 are placed in the src/ThrowableDiagnosticV1Decorators folder.
There are decorators for different Throwables. Diagnostic logic for certain Throwables may have multiple versions, e.g. GuzzleV1, GuzzleV2. Use the latest version if possible. The versions here do not correspond to versions of guzzle, rather versions of the specific decorator. You can implement your own decorator to properly handle Throwables which are specific to your own code, or a package for which a decorator is not available.

For usage details and list of predefined decorators please refer to the corresponding Throwable Diagnostic version.

Buphalo integration

Buphalo templates are available for actors using throwable diagnostic, custom throwable diagnostic decorators as well as their accompanying files.

Prerequisites

The Buphalo templates are provided in a custom template tree. Support for multiple template trees has been added to Buphalo in version 1.1. Ensure you have Buphalo version 1.1 or above installed.
You probably have a script in your project's bin folder running vendor/bin/buphalo with all the needed environment variables. Edit the environment variable for template tree directory paths to include the template tree contained in this package. The environment variable definition might be as below.

Neighborhoods_Buphalo_V1_TemplateTree_Map_Builder_FactoryInterface__TemplateTreeDirectoryPaths=default:$PWD/vendor/neighborhoods/buphalo/template-tree/V1,diagnostic:$PWD/vendor/neighborhoods/throwable-diagnostic-component/template-tree/BuphaloV1

The export above assumes that you have no other custom template trees.

neighborhoods/throwable-diagnostic-component 适用场景与选型建议

neighborhoods/throwable-diagnostic-component 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.41k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 10 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 neighborhoods/throwable-diagnostic-component 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 neighborhoods/throwable-diagnostic-component 我们能提供哪些服务?
定制开发 / 二次开发

基于 neighborhoods/throwable-diagnostic-component 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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