Skip to content

Commit

Permalink
Extend bucket size for throughput calculation to 1 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanel committed Feb 22, 2024
1 parent afad4d7 commit eeef653
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions unfair/scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
LINEWIDTH = 2.5
PREFIX = ""
PERCENTILES = [5, 10, 25, 50, 75, 90, 99.9]
# Bucket size for computing average throughput. To avoid showing transient burstiness,
# this should be larger than the largest possible RTT.
BUCKET_DUR_US = 1e6


def get_queue_mult(exp, vals):
Expand Down Expand Up @@ -216,7 +219,7 @@ def plot_flows_over_time(
initial_time = min(
np.min(pkts[features.ARRIVAL_TIME_FET]) for pkts in flw_to_pkts.values()
)
# Put packets into buckets of 100 milliseconds.
# Put packets into buckets of BUCKET_DUR_US.
for flw, pkts in flw_to_pkts.items():
throughputs = []
current_bucket = []
Expand All @@ -227,10 +230,10 @@ def plot_flows_over_time(

start_idx = current_bucket[0]
start_time = pkts[start_idx][features.ARRIVAL_TIME_FET]
# Create a bucket for every 100 milliseconds.
# Create a bucket for every BUCKET_DUR_US.
if (
len(current_bucket) > 1
and pkt[features.ARRIVAL_TIME_FET] - start_time > 500e3
and pkt[features.ARRIVAL_TIME_FET] - start_time > BUCKET_DUR_US
):
end_idx = current_bucket[-1]
end_time = pkts[end_idx][features.ARRIVAL_TIME_FET]
Expand Down

0 comments on commit eeef653

Please sign in to comment.