This repository was archived by the owner on Sep 22, 2024. It is now read-only.
Add the feature of viewing traffic inside every node in the cluster#90
Open
sebb7 wants to merge 3 commits intoerlanglab:masterfrom
Open
Add the feature of viewing traffic inside every node in the cluster#90sebb7 wants to merge 3 commits intoerlanglab:masterfrom
sebb7 wants to merge 3 commits intoerlanglab:masterfrom
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
mkacper
suggested changes
Nov 12, 2017
| %%% Internal functions | ||
| %%%=================================================================== | ||
| verify_subscribe_reply(Reply) -> | ||
| lists:all(fun(X) -> X =:= ok end, Reply). |
Contributor
There was a problem hiding this comment.
Maybe could you use R instead of X inside the fun? R is closer to Reply than X :)
| {Region, _} = epl_viz_map:pull_region(Node, OldViz), | ||
| merge_focused_nodes_and_conns(Node, Viz, Region). | ||
|
|
||
| merge_focused_nodes_and_conns(_Node, Viz, []) -> |
Contributor
There was a problem hiding this comment.
Maybe better name for this function would be finally_merge_focused_nodes_and_conns(...)?
| %% @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) -> |
Contributor
There was a problem hiding this comment.
What do you think about using clear_focused_nodes_and_conns(...) here?
| finally_merge_focused_nodes_and_conns(Viz, UpdatedRegion, Regions) -> | ||
| maps:merge(Viz, #{nodes => [UpdatedRegion | Regions]}). | ||
|
|
||
| get_message_passing_counters(Node, Proplist, Vizceral, OldMsgPass) -> |
Contributor
There was a problem hiding this comment.
I think that update_message_passing_counters would be more proper here after your changes :)
mkacper
suggested changes
Nov 12, 2017
| finally_merge_focused_conns(Region, OldFocusedConns) -> | ||
| maps:merge(Region, #{connections => OldFocusedConns}). | ||
|
|
||
| finally_merge_focused_nodes_and_conns(Viz, UpdatedRegion, Regions) -> |
Contributor
There was a problem hiding this comment.
What do you think about finally_merge_regions(...) here?
Remove code which unnecessarily manipulates empty Region map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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! :)