Commit 1ffcdea2 authored by Marlene Böhmer's avatar Marlene Böhmer
Browse files

drone log evaluation

parent 956abea5
%% 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")
data_files = {
"sender": "drone/sender.csv",
"receiver": "drone/receiver.csv"
}
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)
```
%% 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)
```
%% Cell type:code id: tags:
``` python
```
This diff is collapsed.
This diff is collapsed.
threads:
cycle_reference:
time_reference:
sender:
Start: PrrtSendRequest
Stop: PrrtReceiveResponse
receiver:
Start: PrrtReceiveRequest
Stop: PrrtSendResponse
transport: # optional
Start: PrrtSendRequest
Stop: PrrtReceiveRequest
total: # optional
Start: PrrtSendRequest
Stop: PrrtReceiveResponse
stamps:
PrrtSendRequest:
Source: sender
Type: time
PrrtReceiveRequest:
Source: receiver
Type: time
UartSendRequest:
Source: receiver
Type: time
UartReceiveResponse:
Source: receiver
Type: time
PrrtSendResponse:
Source: receiver
Type: time
PrrtReceiveResponse:
Source: sender
Type: time
durations:
Processing2:
Start: UartReceiveResponse
Stop: PrrtSendResponse
Source: receiver
Uart:
Start: UartSendRequest
Stop: UartReceiveResponse
Source: receiver
Processing1:
Start: PrrtReceiveRequest
Stop: UartSendRequest
Source: receiver
RoundTripTransport:
Start: PrrtSendResponse
Stop: PrrtReceiveResponse
Source: sender
packet_types:
Data: 0
Redundancy: 1
......@@ -26,7 +26,11 @@ def _create_line(config):
def _creator(duration_name):
if duration_name == "EndToEnd":
return [tr["sender"]["Start"] + "_T", tr["receiver"]["Stop"] + "_T", colors["EndToEnd"], linestyles["EndToEnd"], "EndToEnd"]
try:
return [tr["total"]["Start"] + "_T", tr["total"]["Stop"] + "_T", colors["EndToEnd"], linestyles["EndToEnd"], "EndToEnd"]
except KeyError:
return [tr["sender"]["Start"] + "_T", tr["receiver"]["Stop"] + "_T", colors["EndToEnd"], linestyles["EndToEnd"], "EndToEnd"]
elif duration_name == "Sender":
return [tr["sender"]["Start"] + "_T", tr["sender"]["Stop"] + "_T", colors["sender"], linestyles["sender"], "Sender"]
elif duration_name == "Receiver":
......
......@@ -27,9 +27,9 @@ def _evaluate_file(file_name, stamps, kind, measured_column, sender=False):
# Drop columns of opposing side.
if sender:
df.drop(_extract_stamps_by_src_and_kind(stamps, "receiver"), axis=1, inplace=True)
df.drop(_extract_stamps_by_src_and_kind(stamps, "receiver"), axis=1, inplace=True, errors='ignore')
else:
df.drop(_extract_stamps_by_src_and_kind(stamps, "sender"), axis=1, inplace=True)
df.drop(_extract_stamps_by_src_and_kind(stamps, "sender"), axis=1, inplace=True, errors='ignore')
# Drop rows with value 0 (as they have probably not been written out).
res = df[df[measured_column + "_T"] != 0]
......@@ -97,21 +97,28 @@ def evaluate(sender_file, receiver_file, config, kind=0):
cr = config["cycle_reference"]
# Determine Channel Duration
df["Transport_D"] = df[tr["receiver"]["Start"] + "_T"] - df[tr["sender"]["Stop"] + "_T"]
try:
df["Transport_D"] = df[tr["transport"]["Stop"] + "_T"] - df[tr["transport"]["Start"] + "_T"]
except KeyError:
df["Transport_D"] = df[tr["receiver"]["Start"] + "_T"] - df[tr["sender"]["Stop"] + "_T"]
# Correlate Receiver Timestamps with Sender Timestamps (subtracting Channel Duration)
for s in _stamp_name_by_src_and_type(stamps, "receiver", kind=["time"]):
df[s + "_T"] -= df["Transport_D"]
for src in config["threads"]:
_generate_thread_durations(df, cr, src, stamps)
if config["threads"]:
for src in config["threads"]:
_generate_thread_durations(df, cr, src, stamps)
_generate_durations(df, config)
df["Sender_D"] = df[tr["sender"]["Stop"] + "_T"] - df[tr["sender"]["Start"] + "_T"]
df["Receiver_D"] = df[tr["receiver"]["Stop"] + "_T"] - df[tr["receiver"]["Start"] + "_T"]
df["EndToEnd_D"] = df[tr["receiver"]["Stop"] + "_T"] - df[tr["sender"]["Start"] + "_T"]
try:
df["EndToEnd_D"] = df[tr["total"]["Stop"] + "_T"] - df[tr["total"]["Start"] + "_T"]
except KeyError:
df["EndToEnd_D"] = df[tr["receiver"]["Stop"] + "_T"] - df[tr["sender"]["Start"] + "_T"]
return df
......
Supports Markdown
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