-
Notifications
You must be signed in to change notification settings - Fork 40
Add the feature of viewing traffic inside every node in the cluster #90
base: master
Are you sure you want to change the base?
Conversation
- Modify epl_viz_map:pull_node/2 to do not crash when pulled
node does not exist
- Change epl_ets_viz_map:clean_ets_traffic_from_viz/2 function
and move it to epl_viz_map in order to make it publicly
accessible for the future use
- Subscribe epl_traffic to all nodes and update Vizceral map
for each incoming massage from tracers; added required
functions
apps/epl/src/epl_traffic.erl
Outdated
| %%% Internal functions | ||
| %%%=================================================================== | ||
| verify_subscribe_reply(Reply) -> | ||
| lists:all(fun(X) -> X =:= ok end, Reply). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe could you use R instead of X inside the fun? R is closer to Reply than X :)
apps/epl/src/epl_traffic.erl
Outdated
| {Region, _} = epl_viz_map:pull_region(Node, OldViz), | ||
| merge_focused_nodes_and_conns(Node, Viz, Region). | ||
|
|
||
| merge_focused_nodes_and_conns(_Node, Viz, []) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better name for this function would be finally_merge_focused_nodes_and_conns(...)?
apps/epl/src/epl_viz_map.erl
Outdated
| %% @doc Clears all focused nodes from `RegionName` node. | ||
| -spec clear_focused_nodes_inside_region(RegionName :: name(), Viz :: map()) -> | ||
| map(). | ||
| clear_focused_nodes_inside_region(RegionName, Viz) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using clear_focused_nodes_and_conns(...) here?
apps/epl/src/epl_traffic.erl
Outdated
| finally_merge_focused_nodes_and_conns(Viz, UpdatedRegion, Regions) -> | ||
| maps:merge(Viz, #{nodes => [UpdatedRegion | Regions]}). | ||
|
|
||
| get_message_passing_counters(Node, Proplist, Vizceral, OldMsgPass) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that update_message_passing_counters would be more proper here after your changes :)
apps/epl/src/epl_traffic.erl
Outdated
| finally_merge_focused_conns(Region, OldFocusedConns) -> | ||
| maps:merge(Region, #{connections => OldFocusedConns}). | ||
|
|
||
| finally_merge_focused_nodes_and_conns(Viz, UpdatedRegion, Regions) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about finally_merge_regions(...) here?
Remove code which unnecessarily manipulates empty Region map
It is now possible to view message passing inside each node in the cluster on the epl_traffic tab. In general, you can click on other nodes (not just default) and see traffic inside.
Major changes were made in epl_traffic module but I changed a bit epl_viz_map and epl_ets_viz_map modules. Details:
Issues with the view of nodes which are not default_node - graphic representations of processes are sometimes overlap or the view is almost empty. I think that it can by caused by lack of message passing in the observed nodes. I watched the traffic inside the nodes while running Mnesia example from README and it seems to work decently - I could see message passing between some Mnesia processes.
Guys, please let me know what you think :) @michalslaski @arkgil @baransu @mkacper
To be honest, it is my first contribution to a real project. Thanks to @mkacper for the introduction to ErlangPL and pair-programming sessions which enabled me to create this PR! :)