common.py 591 Bytes
Newer Older
Andreas Schmidt's avatar
Andreas Schmidt committed
1
2
# TODO: Refactor.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def get_outlier_treshold(stats):
    q75 = stats["75%"]
    iqr = q75 - stats["25%"]
    return q75 + 1.5 * iqr

def _dn(x):
    return x + "Time"

def _filter(x, durations, source):
    return durations[x]["Source"] == source

def extract_durations(config):
    durations = config["durations"]

    durations_send = [_dn(x) for x in durations if _filter(x, durations, "sender")]
    durations_recv = [_dn(x) for x in durations if _filter(x, durations, "receiver")]

    return ["EndToEndTime", "SenderTotalTime"] + durations_send + ["ReceiverTotalTime"] + durations_recv