notebook.ipynb 4.95 KB
Newer Older
1 2 3 4
{
 "cells": [
  {
   "cell_type": "markdown",
5
   "metadata": {},
6 7 8 9
   "source": [
    "# X-Lap in Action"
   ]
  },
10 11
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
12
   "execution_count": null,
13
   "metadata": {},
14 15
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
16
    "%matplotlib inline"
17 18
   ]
  },
19 20
  {
   "cell_type": "markdown",
21
   "metadata": {},
22
   "source": [
23
    "## Data Retrieval"
24 25 26 27
   ]
  },
  {
   "cell_type": "code",
28
   "execution_count": null,
29
   "metadata": {},
30 31
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
32
    "from xlap.parse import evaluate, parse_config\n",
33
    "config = parse_config()\n",
34
    "data_files = {\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
35 36
    "    \"sender\": \"rtn2018/20180417_testbed/\",\n",
    "    \"receiver\": \"rtn2018/20180417_testbed/\"\n",
37
    "}\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
38 39 40 41 42 43 44
    "df_1GHz = evaluate(data_files[\"sender\"] + \"sender-1000000.csv\", data_files[\"receiver\"] + \"receiver-1000000.csv\", config=config, kind=0)\n",
    "df_1GHz.name = \"1GHz\"\n",
    "df_2GHz = evaluate(data_files[\"sender\"] + \"sender-2000000.csv\", data_files[\"receiver\"] + \"receiver-2000000.csv\", config=config, kind=0)\n",
    "df_2GHz.name = \"2GHz\"\n",
    "df_3GHz = evaluate(data_files[\"sender\"] + \"sender-3000000.csv\", data_files[\"receiver\"] + \"receiver-3000000.csv\", config=config, kind=0)\n",
    "df_3GHz.name = \"3GHz\"\n",
    "dfs = [df_1GHz, df_2GHz, df_3GHz]"
45 46 47 48
   ]
  },
  {
   "cell_type": "markdown",
49
   "metadata": {},
50
   "source": [
51
    "## Individual Packet Traces"
52 53 54 55
   ]
  },
  {
   "cell_type": "code",
56 57
   "execution_count": null,
   "metadata": {},
58 59
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
60 61
    "from xlap.analyse.trace import traces\n",
    "traces(df_1GHz, config, global_xaxis=True)"
62 63 64 65
   ]
  },
  {
   "cell_type": "markdown",
66
   "metadata": {},
67
   "source": [
68
    "## Trace Jitter Analysis"
69 70 71 72
   ]
  },
  {
   "cell_type": "code",
73 74 75
   "execution_count": null,
   "metadata": {},
   "outputs": [],
76
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
77
    "from xlap.analyse.jitter import multi_trace_jitter\n",
78
    "multi_trace_jitter(dfs, config)"
79 80 81 82
   ]
  },
  {
   "cell_type": "markdown",
83
   "metadata": {},
84
   "source": [
85
    "## Latency Distributions"
86 87 88 89
   ]
  },
  {
   "cell_type": "code",
90 91 92
   "execution_count": null,
   "metadata": {},
   "outputs": [],
93
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
94 95 96
    "from xlap.analyse.cdf import multi_cdf\n",
    "from xlap.analyse.util import colors\n",
    "import copy\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
97
    "cfg = copy.deepcopy(config)\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
98 99 100 101 102 103 104
    "list(map(cfg[\"durations\"].pop, (\"Decoding\",\n",
    "                                \"ReceiverIPC\",\n",
    "                                \"HandlePacket\", \n",
    "                                \"Feedback\", \n",
    "                                \"SenderIPC\",\n",
    "                                \"SenderEnqueued\",\n",
    "                                \"Enqueue\")))\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
105
    "multi_cdf(dfs, cfg, colors=colors)"
106 107 108 109 110 111
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
112
    "## Correlation with E2E Latency"
113 114 115 116
   ]
  },
  {
   "cell_type": "code",
117 118 119 120
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
121
    "from xlap.analyse.correlation import multi_correlation\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
122
    "multi_correlation(dfs, config, colors=colors, figsize=(3.0,2.0), cols=4)"
123 124 125 126
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
127
   "metadata": {},
128
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
129
    "# $\\Delta$elta\n",
130
    "## Latency Criticality"
131 132 133 134 135
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
136
   "metadata": {},
137
   "outputs": [],
138
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
139 140
    "from xlap.analyse.latency import analyse\n",
    "d = analyse(df_1GHz, config)"
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Correlations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "d.corr.sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Control Flow Graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "d.cfg"
   ]
174 175 176 177 178
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
179
    "## Timing Behaviour"
180 181 182 183 184 185 186 187
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
188 189
    "from xlap.analyse.timing import timing_behaviour\n",
    "timing_behaviour(df_1GHz, df_2GHz, config)"
190 191 192 193 194 195 196 197
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
198
    "timing_behaviour(df_1GHz, df_3GHz, config)"
199 200 201 202 203 204 205 206
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
207
    "timing_behaviour(df_2GHz, df_3GHz, config)"
208
   ]
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
  }
 ],
 "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
227
   "version": "3.6.8"
228 229 230
  }
 },
 "nbformat": 4,
Andreas Schmidt's avatar
Andreas Schmidt committed
231
 "nbformat_minor": 4
232
}