Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
02f0f815
Commit
02f0f815
authored
Aug 31, 2018
by
juga
Browse files
Add method to find bw of a node
useful to combine data when plotting
parent
bce5f898
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
02f0f815
...
...
@@ -724,6 +724,16 @@ class V3BWFile(object):
def
median_bw
(
self
):
return
median
([
l
.
bw
for
l
in
self
.
bw_lines
])
def
bw_line_for_node_id
(
self
,
node_id
):
"""Returns the bandwidth line for a given node fingerprint.
Used to combine data when plotting.
"""
bwl
=
[
l
for
l
in
self
.
bw_lines
if
l
.
node_id
==
node_id
]
if
bwl
:
return
bwl
[
0
]
return
None
def
to_plt
(
self
,
attrs
=
[
'bw'
],
sorted_by
=
None
):
"""Return bandwidth data in a format useful for matplotlib.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment