Skip to content

Commit

Permalink
Add bytes_transferred to each edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidenori committed Jun 15, 2020
1 parent b91e443 commit a382c69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/OverlaySurvey.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def add_new_node(graph, label, version=""):
graph.add_node(label, label=label, version=version)


def add_new_edge(graph, u, v):
def add_new_edge(graph, u, v, bytes_transferred):
if graph.has_edge(u, v):
return
graph.add_edge(u, v)
graph.add_edge(u, v, bytes_transferred=bytes_transferred)


def next_peer(direction_tag, node_info):
Expand Down Expand Up @@ -52,7 +52,7 @@ def update_results(graph, parent_info, parent_key, results, is_inbound):
results[direction_tag][other_key] = peer
add_new_node(graph, parent_key)
add_new_node(graph, other_key, peer["version"])
add_new_edge(graph, other_key, parent_key)
add_new_edge(graph, other_key, parent_key, peer["bytesWritten"] + peer["bytesRead"])

if "numTotalInboundPeers" in parent_info:
results["totalInbound"] = parent_info["numTotalInboundPeers"]
Expand Down

0 comments on commit a382c69

Please sign in to comment.