drone-notebook.ipynb 2.85 KB
Newer Older
Marlene Böhmer's avatar
Marlene Böhmer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# X-Lap in Action"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Data Retrieval"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xlap.parse import evaluate, parse_config\n",
    "config = parse_config(\"drone/xlap.yml\")\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
34
    "protocol = \"python\"\n",
Marlene Böhmer's avatar
Marlene Böhmer committed
35
    "data_files = {\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
36
37
    "    \"sender\": \"drone/{}-bridge/sender.csv\".format(protocol),\n",
    "    \"receiver\": \"drone/{}-bridge/receiver.csv\".format(protocol)\n",
Marlene Böhmer's avatar
Marlene Böhmer committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    "}\n",
    "df_1 = evaluate(data_files[\"sender\"], data_files[\"receiver\"], config=config, kind=0)\n",
    "df_1.name = \"\"\n",
    "dfs = [df_1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Individual Packet Traces"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xlap.analyse.trace import traces\n",
    "traces(df_1, config, global_xaxis=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Trace Jitter Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "from xlap.analyse.jitter import trace_jitter\n",
77
    "trace_jitter(df_1, config,file_name=\"{}_trace_jitter.pdf\".format(protocol),export=True, default_durations=False)"
Marlene Böhmer's avatar
Marlene Böhmer committed
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Latency Distributions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xlap.analyse.cdf import multi_cdf\n",
    "from xlap.analyse.util import colors\n",
    "import copy\n",
    "cfg = copy.deepcopy(config)\n",
    "\n",
    "multi_cdf(dfs, cfg, colors=colors)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Correlation with E2E Latency"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xlap.analyse.correlation import multi_correlation\n",
    "multi_correlation(dfs, config, colors=colors, figsize=(3.0,2.0), cols=4)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
Andreas Schmidt's avatar
Andreas Schmidt committed
135
   "version": "3.6.9"
Marlene Böhmer's avatar
Marlene Böhmer committed
136
137
138
139
140
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}