Commit e9da367f authored by Andreas Schmidt's avatar Andreas Schmidt

Refactored common into util.

parent c26ea990
# TODO: Refactor.
def get_outlier_threshold(stats):
q75 = stats["75%"]
iqr = q75 - stats["25%"]
return q75 + 1.5 * iqr
def _dn(x):
return x + "_D"
def _filter(x, durations, source):
return durations[x]["Source"] == source
def extract_durations(config):
durations = config["durations"]
durations_send = [x for x in durations if _filter(x, durations, "sender")]
durations_recv = [x for x in durations if _filter(x, durations, "receiver")]
return ["EndToEnd", "Sender"] + durations_send + ["Receiver"] + durations_recv
import pandas as pd
import matplotlib.pyplot as plt
from xlap.analyse.common import get_outlier_threshold, extract_durations
from xlap.analyse.util import get_outlier_threshold, extract_durations
from xlap.analyse import box
......
import numpy as np
import matplotlib.pyplot as plt
from xlap.analyse.common import extract_durations
from xlap.analyse.util import extract_durations
def _create_line(config):
......
......@@ -7,3 +7,18 @@ def hist(df):
def scatter(df, column):
plt.scatter(df.index, df[column], grid=True)
def get_outlier_threshold(stats):
q75 = stats["75%"]
iqr = q75 - stats["25%"]
return q75 + 1.5 * iqr
def extract_durations(config):
durations = config["durations"]
durations_send = [x for x in durations if durations[x]["Source"] == "sender"]
durations_recv = [x for x in durations if durations[x]["Source"] == "receiver"]
return ["EndToEnd", "Sender"] + durations_send + ["Receiver"] + durations_recv
\ No newline at end of file
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