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
be90985e
Commit
be90985e
authored
Aug 31, 2018
by
juga
Browse files
Add methods to log stats
parent
02f0f815
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
be90985e
...
...
@@ -724,6 +724,22 @@ class V3BWFile(object):
def
median_bw
(
self
):
return
median
([
l
.
bw
for
l
in
self
.
bw_lines
])
@
property
def
max_bw
(
self
):
return
max
([
l
.
bw
for
l
in
self
.
bw_lines
])
@
property
def
min_bw
(
self
):
return
min
([
l
.
bw
for
l
in
self
.
bw_lines
])
@
property
def
info_stats
(
self
):
if
not
self
.
bw_lines
:
return
[
log
.
info
(
': '
.
join
([
attr
,
str
(
getattr
(
self
,
attr
))]))
for
attr
in
[
'sum_bw'
,
'mean_bw'
,
'median_bw'
,
'num'
,
'max_bw'
,
'min_bw'
]]
def
bw_line_for_node_id
(
self
,
node_id
):
"""Returns the bandwidth line for a given node fingerprint.
...
...
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