Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanel committed Feb 19, 2024
1 parent 66f7bce commit 79b7475
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions unfair/scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,21 +720,29 @@ def calculate_maxmin_ratios(params, flw_to_pkts, flw_to_sender, sender_to_flws):
bneck_to_avg_maxmin_ratio = {}
for start_s, end_s, _ in bneck_situations:
bneck = (start_s, end_s)
print("bneck", bneck)
flw_to_maxmin_ratio = {}
for flw, pkts in flw_to_pkts.items():
print("flw", flw)
print("len(pkts)", len(pkts))
print("flw start", pkts[0][features.ARRIVAL_TIME_FET])
print("flw end", pkts[-1][features.ARRIVAL_TIME_FET])
print("last cutoff idx", flw_to_last_cutoff_idx[flw])
cutoff_idx = utils.find_bound(
pkts[features.ARRIVAL_TIME_FET],
end_s * 1e6,
flw_to_last_cutoff_idx[flw],
len(pkts) - 1,
"before",
)
print("cutoff idx", cutoff_idx)
tpus_bps = utils.safe_tput_bps(
pkts, flw_to_last_cutoff_idx[flw], cutoff_idx
)
maxmin_rate_bps = bneck_to_sender_to_maxminbps[bneck][flw_to_sender[flw]]
flw_to_maxmin_ratio[flw] = tpus_bps / maxmin_rate_bps
flw_to_last_cutoff_idx[flw] = cutoff_idx + 1
print()
bneck_to_avg_maxmin_ratio[bneck] = np.average(
list(flw_to_maxmin_ratio.values())
)
Expand Down

0 comments on commit 79b7475

Please sign in to comment.