notebook.ipynb 5.09 KB
Newer Older
1 2
{
 "cells": [
3 4
  {
   "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 23
   "source": [
    "## Data Retrieval"
24 25 26 27
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
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",
Andreas Schmidt's avatar
Andreas Schmidt committed
56
   "execution_count": null,
57
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
58
   "outputs": [],
59
   "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",
Andreas Schmidt's avatar
Andreas Schmidt committed
73
   "execution_count": null,
74
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
75
   "outputs": [],
76
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
77
    "from xlap.analyse.jitter import multi_trace_jitter\n",
78 79 80 81 82 83 84
    "multi_trace_jitter(dfs, config)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
85
    "## Latency Distributions"
86 87 88 89 90 91 92 93
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "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",
Andreas Schmidt's avatar
Andreas Schmidt committed
117
   "execution_count": null,
118
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
119
   "outputs": [],
120
   "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 129 130 131 132 133 134
   "source": [
    "## Latency Criticality"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
135
   "metadata": {},
136 137
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
138 139
    "from xlap.analyse.latency import analyse\n",
    "d = analyse(df_1GHz, config)"
140 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
   ]
  },
  {
   "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"
   ]
173 174 175 176 177
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
178
    "## Timing Behaviour"
179 180 181 182 183 184 185 186
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
187 188
    "from xlap.analyse.timing import timing_behaviour\n",
    "timing_behaviour(df_1GHz, df_2GHz, config)"
189 190 191 192 193 194 195 196
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
197
    "timing_behaviour(df_1GHz, df_3GHz, config)"
198 199 200 201 202 203 204 205
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
206
    "timing_behaviour(df_2GHz, df_3GHz, config)"
207
   ]
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
  }
 ],
 "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
226
   "version": "3.6.8"
227 228 229
  },
  "widgets": {
   "state": {
230
    "df95aa8c42974dfeaf8e0a2c05100645": {
231 232 233 234 235 236 237 238
     "views": [
      {
       "cell_index": 6
      }
     ]
    }
   },
   "version": "1.2.0"
239 240 241 242 243
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}