Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
X-Lap
Commits
e7dcf36c
Commit
e7dcf36c
authored
Apr 20, 2020
by
Andreas Schmidt
Browse files
+= allow to hide default durations
parent
39cdd957
Changes
4
Hide whitespace changes
Inline
Side-by-side
drone-notebook.ipynb
View file @
e7dcf36c
...
...
@@ -74,7 +74,7 @@
"outputs": [],
"source": [
"from xlap.analyse.jitter import trace_jitter\n",
"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:
# X-Lap in Action
%% Cell type:code id: tags:
```
python
%
matplotlib
inline
```
%% Cell type:markdown id: tags:
## Data Retrieval
%% Cell type:code id: tags:
```
python
from
xlap.parse
import
evaluate
,
parse_config
config
=
parse_config
(
"drone/xlap.yml"
)
protocol
=
"python"
data_files
=
{
"sender"
:
"drone/{}-bridge/sender.csv"
.
format
(
protocol
),
"receiver"
:
"drone/{}-bridge/receiver.csv"
.
format
(
protocol
)
}
df_1
=
evaluate
(
data_files
[
"sender"
],
data_files
[
"receiver"
],
config
=
config
,
kind
=
0
)
df_1
.
name
=
""
dfs
=
[
df_1
]
```
%% Cell type:markdown id: tags:
## Individual Packet Traces
%% Cell type:code id: tags:
```
python
from
xlap.analyse.trace
import
traces
traces
(
df_1
,
config
,
global_xaxis
=
True
)
```
%% Cell type:markdown id: tags:
## Trace Jitter Analysis
%% 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
%% Cell type:code id: tags:
```
python
from
xlap.analyse.cdf
import
multi_cdf
from
xlap.analyse.util
import
colors
import
copy
cfg
=
copy
.
deepcopy
(
config
)
multi_cdf
(
dfs
,
cfg
,
colors
=
colors
)
```
%% Cell type:markdown id: tags:
## Correlation with E2E Latency
%% Cell type:code id: tags:
```
python
from
xlap.analyse.correlation
import
multi_correlation
multi_correlation
(
dfs
,
config
,
colors
=
colors
,
figsize
=
(
3.0
,
2.0
),
cols
=
4
)
```
...
...
python_trace_jitter.pdf
View file @
e7dcf36c
No preview for this file type
xlap/analyse/jitter.py
View file @
e7dcf36c
...
...
@@ -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
())
...
...
xlap/analyse/util.py
View file @
e7dcf36c
...
...
@@ -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
)):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment