commit 63804459d03cac55b9862ddd8d56b10981e6eeca Merge: 4901c66 19713fa Author: juga0 juga@riseup.net Date: Mon Oct 29 08:48:58 2018 +0000
Merge branch 'ticket28215_torflow_min'
CHANGELOG.md | 2 ++ sbws/lib/v3bwfile.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --cc sbws/lib/v3bwfile.py index 0020c50,dfa1bbd..a070150 --- a/sbws/lib/v3bwfile.py +++ b/sbws/lib/v3bwfile.py @@@ -765,11 -761,11 +765,11 @@@ class V3BWFile(object) log.info("Calculating relays' bandwidth using Torflow method.") bw_lines_tf = copy.deepcopy(bw_lines) # mean (Torflow's strm_avg) - mu = mean([l.bw_bs_mean for l in bw_lines]) + mu = mean([l.bw_mean for l in bw_lines]) # filtered mean (Torflow's filt_avg) - muf = mean([min(l.bw_mean, mu) for l in bw_lines]) - muf = mean([max(l.bw_bs_mean, mu) for l in bw_lines]) ++ muf = mean([max(l.bw_mean, mu) for l in bw_lines]) # bw sum (Torflow's tot_net_bw or tot_sbw) - sum_bw = sum([l.bw_bs_mean for l in bw_lines]) + sum_bw = sum([l.bw_mean for l in bw_lines]) # Torflow's clipping hlimit = sum_bw * TORFLOW_BW_MARGIN log.debug('sum %s', sum_bw) @@@ -784,9 -780,9 +784,9 @@@ # just applying the formula above: bw_new = kb_round_x_sig_dig( max( - l.bw_bs_mean / mu, # ratio - max(l.bw_bs_mean, mu) / muf # ratio filtered - ) * desc_obs_bw, \ + l.bw_mean / mu, # ratio - min(l.bw_mean, mu) / muf # ratio filtered ++ max(l.bw_mean, mu) / muf # ratio filtered + ) * desc_bw_obs, \ digits=num_round_dig) # convert to KB # Cap maximum bw if cap is not None:
tor-commits@lists.torproject.org