Commit e7dcf36c authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

+= allow to hide default durations

parent 39cdd957
......@@ -44,11 +44,11 @@
%% Cell type:code id: tags:
``` python
from xlap.analyse.jitter import trace_jitter
trace_jitter(df_1, config,file_name="{}_trace_jitter.pdf".format(protocol),export=True)
trace_jitter(df_1, config,file_name="{}_trace_jitter.pdf".format(protocol),export=True, default_durations=False)
```
%% Cell type:markdown id: tags:
## Latency Distributions
......
No preview for this file type
......@@ -29,11 +29,11 @@ def jitter_causes(df, config, export=False, file_name=None, figsize=(8,3), color
fig.savefig(file_name)
print("Outliers:", len(outliers), ";", "Threshold[us]:", threshold)
def trace_jitter(data_frame, config=None, threshold=None, export=False, file_name=None, figsize=(8, 4.5)):
def trace_jitter(data_frame, config=None, threshold=None, export=False, file_name=None, figsize=(8, 4.5), default_durations=True):
"""
Displays (and saves) a stacked boxplot of durations.
"""
data_frame = data_frame[[x + "_D" for x in extract_durations(config)]]
data_frame = data_frame[[x + "_D" for x in extract_durations(config, default_durations)]]
if threshold is None:
threshold = get_outlier_threshold(data_frame["EndToEnd_D"].describe())
......
......@@ -30,13 +30,16 @@ def get_outlier_threshold(stats):
return q75 + 1.5 * iqr
def extract_durations(config):
def extract_durations(config, default_durations=True):
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
sender_default_durations = ["Sender"] if default_durations else []
receiver_default_durations = ["Receiver"] if default_durations else []
return ["EndToEnd"] + sender_default_durations + durations_send + receiver_default_durations + durations_recv
def box(data_frame, xlim=None, export=False, file_name=None, figsize=(8, 4.5)):
......
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