message-flow-analyzer
message-flow-analyzer copied to clipboard
Nodes analyzer: v0.2 refatoring
This PR contains a complete rewrite of the internal message flow structure. I've simplified the structure to only use nodes
and edges
instead of messages, handlers, aggregates, ... Those are just node types now so it is easier to understand and customize the message flow.
And the message flow can now directly be imported into the mgmt UI. This resolves #15
Other output formatters are removed but you can still write your own if needed.
Documentation is also included in the PR.
I just gave it a try and got:
PHP Fatal error: Uncaught Error: Class 'MessageHandlerCollector' not found in .../vendor/prooph/message-flow-analyzer/src/Helper/ProjectTraverserFactory.php:69
Stack trace:
#0 .../vendor/prooph/message-flow-analyzer/src/Cli/AnalyzeProjectCommand.php(90): Prooph\MessageFlowAnalyzer\Helper\ProjectTraverserFactory::buildTraverserFromConfig(Array)
#1 .../vendor/symfony/console/Command/Command.php(252): Prooph\MessageFlowAnalyzer\Cli\AnalyzeProjectCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 .../vendor/symfony/console/Application.php(865): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 .../vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Objec in .../vendor/prooph/message-flow-analyzer/src/Helper/ProjectTraverserFactory.php on line 69
Same thing for EventRecorderCollector
, EventRecorderCollector
, EventRecorderInvokerCollector
.
Could you add a link to a new "default" prooph_analyzer.json
configuration file, based on this: https://github.com/prooph/message-flow-analyzer/blob/nodes_analyser/docs/configuration.md#classvisitors
?
{
"name": "Default Project",
"fileInfoFilters": [
"ExcludeVendorDir",
"ExcludeTestsDir",
"ExcludeHiddenFileInfo",
"IncludePHPFile"
],
"classVisitors": [
"MessageCollector",
"CommandHandlerCollector",
"MessageProducerCollector",
"AggregateMethodCollector",
"EventListenerCollector"
]
}
@codeliner First run, finished OK, but I got only Nodes
- no Edges
.
Tried to run it again and got:
Edge with id e5fa07cd10ad6806e3098db16b3793724418a228_6f4a1d2478dd80d681f0e34da8cd07f2c0812106 is already set. Got {"data":{"id":"e5fa07cd10ad6806e3098db16b3793724418a228_6f4a1d2478dd80d681f0e34da8cd07f2c0812106","source":"e5fa07cd10ad6806e3098db16b3793724418a228","target":"6f4a1d2478dd80d681f0e34da8cd07f2c0812106"}}
even after clearing the cache and deleting the output file.
@kochen once the PR is merged the link to example config will reference the new example config file
@kochen regarding the problem with no edges. You run it against your own project right? Any chance you can give me more information why no edges are added? It runs perfectly fine against proophessor-do but that was my only testing playground so far. Going to run it against one of our production systems but I alrready know that I need project specific class visitors for the project bc we work with some additions to the OSS version of prooph/event-sourcing in that project.
@kochen can you try again with my latest changes? I've removed $messageFlow->addEdge()
and always use $messageFlow->setEdge()
now, so duplicate edges should no longer cause exceptions.
@codeliner I just tried with the (current) latest changes and the result is the same - no edges between nodes.
I've tried limiting is to one src/{context}
and not the entire src
.
My domain classes are mostly based on those from the Proophesor-do
.
@kochen I'm analyzing a very large project with this branch. It definitely works so we need to find out why it is not working for you.
Can you post some code snippets like a command handler, an aggregate, one or two commands, events?
Do you use default prooph classes or some specials?