prooph/message-flow-analyzer
Composer 安装命令:
composer require prooph/message-flow-analyzer
包简介
Static code analyzer for prooph projects
README 文档
README
A static code analyzer to extract message flow of a prooph project
Installation
composer require --dev prooph/message-flow-analyzer
Configuration
The analyzer can be configured using a json file. By default the analyzer uses a prooph_analyzer.json located in the current working directory.
An example of a default config can be found in the test example project
Run
php vendor/bin/prooph-analyzer project:analyze
Why?
The prooph message flow analyzer scans your project for prooph messages and collects information how these messages flow through your project source code :)
The analysis contains information about:
- commands, events, queries
- message handlers per message (command handler, event listner, process manager, ...)
- message producers per message (controller, cli commands, process manager, ...)
- event recorders per event (classes implementing prooph's AggregateRoot or using the EventProducerTrait)
The message flow is written to an output file (prooph_message_flow.json by default).
For now that's it. But imagine what you can do with this information! We'll add different output formatters to generate config for d3js or draw.io.
The message flow analyzer will also be part of the upcoming event-store-mgmt-ui and will allow you to connect the message flow with your event streams
for debugging and monitoring.
How?
The package uses the excellent libraries roave/better-reflection and nikic/php-parser (which is used by Roave/BetterReflection internally, too)
WIP
prooph/message-flow-analyzer and the event-store-mgmt-ui are work in progress. There is no roadmap defined yet. If you think your project could benefit
from a stable version and you or your company would like to support development then get in touch.
Filters
You can add include and exclude filters for files and directories. prooph/message-flow-analyzer ships with some default filters.
Check the linked example config above. The filter implementations can be found in the Filter dir
ClassVisitors
Class visitors are called for every php class found in the project and not excluded by a filter.
They take a Roave\BetterReflection\Reflection\ReflectionClass and the Prooph\MessageFlowAnalyzer\MessageFlow as input and if a visitor finds something
interesting in the class it can add this information to the MessageFlow.
Again prooph/message-flow-analyzer ships with default class visitors (see example config) which can be found in the Visitor dir.
Run it against proophessor-do
You can see prooph/message-flow-analyzer in action by running it against proophessor-do.
- Clone proophessor-do
- Add
prooph/message-flow-analyzer: dev-masterto therequire-devconfig of proophessor-do'scomposer.json - Run composer install
- Copy prooph_analyzer.json into root dir of proophessor-do
- Copy ExcludeBlacklistedFiles.php into
src/Infrastructure/ProophAnalyzer. This is needed because proophessor-do contains a prepared factory for mongodb connection but mongo is not installed by default so the mongo classes cannot be loaded. - Add
"Prooph\\ProophessorDo\\Infrastructure\\ProophAnalyzer\\ExcludeBlacklistedFiles"as last entry in theprooph_analyzer.jsonfileInfoFiltersarray. - Run
php vendor/bin/prooph-analyzer project:analyzeand watch the generated output fileprooph_message_flow.json
If this is too much work right now and you only want to see the result: prooph_message_flow.json
prooph/message-flow-analyzer 适用场景与选型建议
prooph/message-flow-analyzer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.95k 次下载、GitHub Stars 达 30, 最近一次更新时间为 2017 年 11 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「analyzer」 「prooph」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 prooph/message-flow-analyzer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 prooph/message-flow-analyzer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 prooph/message-flow-analyzer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Event Store Client for async TCP connections
PSR-15 EventStore HTTP Middleware
Log analyzer widget for yii2
Event Store HTTP Client
HumusAmqp Producer for Prooph Service Bus
Laravel package for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots
统计信息
- 总下载量: 2.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-11-01