notebook.ipynb 3.67 KB
Newer Older
1
2
{
 "cells": [
3
4
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
5
   "metadata": {},
6
7
8
9
10
11
   "source": [
    "# X-Lap in Action"
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
12
   "metadata": {},
13
14
15
16
   "source": [
    "## Imports"
   ]
  },
17
18
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
19
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
20
21
22
   "metadata": {
    "collapsed": true
   },
23
24
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
25
26
27
    "import logging\n",
    "logger = logging.getLogger()\n",
    "logger.setLevel(logging.DEBUG)\n",
28
29
    "from ipywidgets import interact, interactive, fixed, interact_manual\n",
    "import ipywidgets as widgets\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
30
    "from xlap.parse import evaluate, evaluate_side, parse_config\n",
31
    "import xlap.analyse.jitter as jitter\n",
32
    "from xlap.analyse.regress import linear as linear_regression\n",
33
    "from xlap.analyse.trace import traces\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
34
    "from xlap.analyse.correlation import correlation\n",
35
    "from xlap.analyse.latency import analyse\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
36
37
    "import pandas as pd\n",
    "%matplotlib inline"
38
39
40
41
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
42
   "metadata": {},
43
44
   "source": [
    "## Data Retrieval"
45
46
47
48
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
49
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
50
51
52
   "metadata": {
    "collapsed": true
   },
53
54
55
56
   "outputs": [],
   "source": [
    "config = parse_config()\n",
    "data_files = config[\"data_files\"]\n",
57
    "original = evaluate(data_files[\"sender\"], data_files[\"receiver\"], config=config, kind=0)"
58
59
60
   ]
  },
  {
61
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
62
   "metadata": {},
63
   "source": [
64
    "## Traces"
65
66
67
68
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
69
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
70
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
71
   "outputs": [],
72
   "source": [
73
74
75
76
77
    "traces(original, config)"
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
78
   "metadata": {},
79
80
   "source": [
    "## Jitter Analysis"
81
82
83
84
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
85
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
86
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
87
   "outputs": [],
88
   "source": [
89
    "df = jitter.prep(original, config=config)\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
90
    "jitter.trace_jitter(df, threshold=500)"
91
92
   ]
  },
93
94
95
96
97
98
99
100
101
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Correlation"
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
102
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
103
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
104
   "outputs": [],
105
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
106
    "correlation(df[df[\"EndToEnd_D\"] < 500], config)"
107
108
   ]
  },
109
110
111
112
113
114
115
116
117
118
119
120
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Latency Criticality"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
121
122
123
   "metadata": {
    "collapsed": true
   },
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
   "outputs": [],
   "source": [
    "d = analyse(original, config)"
   ]
  },
  {
   "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"
   ]
  },
161
162
163
164
165
166
167
168
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  }
 ],
 "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",
   "version": "3.5.2"
188
189
190
  },
  "widgets": {
   "state": {
191
    "df95aa8c42974dfeaf8e0a2c05100645": {
192
193
194
195
196
197
198
199
     "views": [
      {
       "cell_index": 6
      }
     ]
    }
   },
   "version": "1.2.0"
200
201
202
203
204
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}