Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storing all messages between actors to csv files #3155
Storing all messages between actors to csv files #3155
Changes from all commits
a400580
8b659d4
91c2790
ff034bf
462e3d9
e45b4a8
8588e41
e1df9e9
5b294e2
df16de3
8a41213
8c3eb5f
0d4c547
bc1f667
7157db6
64684d5
5497665
eba0168
302e58b
f86ce4f
0d68b89
45bafe2
e1bc914
35ff2c6
c54f30d
7fbacd7
6456972
5543f9c
be4c8e5
039c3b1
50a755a
1f0eaa3
f42c5b0
d5f5cfa
d2e4ebb
d10adf7
c1e13c2
66d8df6
7365d95
c946b62
edfc950
854920d
b7e6207
72f7d8d
27b8170
4dd6514
f5bc956
2b123fe
df6626d
cba2934
ddcdfc1
e1624bf
603a017
cdd30d0
5917efc
06852bf
b7e353d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Auto Capturing Beam Messages
Capturing most messages that BEAM Actors generate
BEAM uses triggerId to trace down all the actor interactions starting from TriggerWithId Event that is sent by the Scheduler. When developing a new message type, extend it from HasTriggerId trait in order to trace these messages. In order to enable saving messages to csv files one needs to add the following property to beam.conf file:
The files are saved in the iteration directories, ie$RUN_OUTPUT_DIR$ /ITERS/it.0/0.actor_messages_0.csv.gz. There may be multiple of these files per iteration. For the scenario sf-light-1k about 400Mb of gzipped data generated.
Generated csv files
The files contains the following columns
How to visualize them
VisualizingApp can convert these files to different diagrams. It creates PlantUML files that can be easily converted to pictures. You can run it with gradle with the following command:
Parameters
Note
For Sequence diagram it's always better to provide either a single limited size file as an input or a person-id for limiting the number of interactions in order to avoid creating a huge file.
Diagram types
Sequence
Sequence diagrams display every line from the beam message csv files. Because of that one always needs to limit the number of messages processed. It can be done by providing a small file that is filtered down to interesting messages. And also it can be done via providing person-id as a parameter to VisualizingApp.
This is an example of a sequence diagram for a person.
This is an example of a sequence diagram for a ridehail agent. It is produced by filtering the ridehail agent messages with pandas and saving them ot a csv with the following script.
Actor Message State Diagram
It's not a real state diagram. It has actors as nodes and messages as edges between nodes. This diagram is generated with setting parameter --diagram-type=ActorAsState. The picture of this diagram is pretty big and messy. It makes sense to filter the messages by providing --person-id parameter.
Single Actor Message State Diagram
It's diagram is similar to the previous one. But it uses only messages that go to/from a single actor (i.e. RideHailManager). This diagram is generated with setting parameter --diagram-type=SingleActorAsState. The --output parameter must point to a folder because the VisualizingApp generates multiple puml files (one for each actor).
This is an example of Actor Message state diagram for ChargingNetworkManager actor.
Agent State Diagram
This diagram is generated with setting parameter --diagram-type=AgentState. It's a real state diagram which shows agent states and transitions between them. The --output parameter must point to a folder because the VisualizingApp generates multiple puml files (one for each agent). This is an example state diagram
Converting puml files to pictures
Converting puml files to pictures can be done in a number of ways. The easiest way would be running the following command for multiple files:
For a single file: