jackdpeterson/status-aware
Composer 安装命令:
composer require jackdpeterson/status-aware
包简介
Return an aggregated status of underlying services with some debugging information. Useful for API dashboards
README 文档
README
A way to report on the status of your service and its subcomponents.
The overall goal of this module is to make reporting on the status of sub-components of an API developer-friendly and non-intrusive. It is anticipated that the primary consumer of those data provided by this module would be a user-friendly dashboard or a service like Pingdom.
Stability note
This module is NOT ready for production. While it probably won't have any major issues ... unit tests have not yet been written. Nor have edge-cases been sorted out when actually using this module.
Installation
composer.json require section:
"jackdpeterson/status-aware" : "dev-master"
Edit config/application.config.php:
return array (
'modules' => array(
...
'StatusAware'
...
)
);
Provide status data
- Create a class that implements the StatusAware\StatusInterface interface.
- Figure out how you will check for status of the component in question (e.g., a CURL call w/ TIMEOUTS FOR FAILURE HANDLING
- return an array like so:
public function getServiceStatus() {
return array(
'name' => 'something identifiable',
'is_critical' => true,
'status' => 'up',
'message' => ''
);
}
reserved fields and their formats in the response array:
'name' => (string) that helps you identify the service/component in question
'status' => (string) 'up','down','degraded'
'is_critical' => (boolean) Is this functionality critical to your API? If down then the overall status will be 'down'.
'message' => '' => if 'up', the message is expected to be blank, ''. Otherwise it is assumed that you will provide a useful debugging message about the condition of soft-failure or hard-failure.
Providing additional status data
You can certainly provide more information in the getServiceStatus() array like stack traces ... so long as you cast the data as a string.
Get status data
perform an HTTP GET request to /status will respond with JSON data about the status.
Important and worth re-emphasizing:
Set timeouts on your responses and handle exceptions. Otherwise if something is down ... this may not return anything!
jackdpeterson/status-aware 适用场景与选型建议
jackdpeterson/status-aware 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23.71k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jackdpeterson/status-aware 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jackdpeterson/status-aware 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 23.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: 未知许可证
- 更新时间: 2015-09-11