Commit be90985e authored by juga's avatar juga
Browse files

Add methods to log stats

parent 02f0f815
......@@ -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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment