GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Commit 5159662a authored by juga  's avatar juga 💬

chg: scaling: Add filtered bandwidth function

to calculate the filtered bandwidth for each relay.
parent 30334218
from statistics import mean
def bw_measurements_from_results(results):
return [
dl['amount'] / dl['duration']
for r in results for dl in r.downloads
def bw_filt(bw_measurements):
"""Filtered bandwidth for a relay.
It is the equivalent to Torflow's ``filt_sbw``.
``mu`` in this function is the equivalent to Torflow's ``sbw``.
mu = mean(bw_measurements)
bws_gte_mean = filter(lambda bw: bw >= mu, bw_measurements)
return mean(bws_gte_mean)
Markdown is supported
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