notebook.ipynb 3.48 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,
50
   "metadata": {},
51
52
53
54
   "outputs": [],
   "source": [
    "config = parse_config()\n",
    "data_files = config[\"data_files\"]\n",
55
    "original = evaluate(data_files[\"sender\"], data_files[\"receiver\"], config=config, kind=0)"
56
57
58
   ]
  },
  {
59
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
60
   "metadata": {},
61
   "source": [
62
    "## Traces"
63
64
65
66
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
67
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
68
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
69
   "outputs": [],
70
   "source": [
71
72
73
74
75
    "traces(original, config)"
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
76
   "metadata": {},
77
78
   "source": [
    "## Jitter Analysis"
79
80
81
82
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
83
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
84
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
85
   "outputs": [],
86
   "source": [
87
    "df = jitter.prep(original, config=config)\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
88
    "jitter.trace_jitter(df, threshold=500)"
89
90
   ]
  },
91
92
93
94
95
96
97
98
99
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Correlation"
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
100
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
101
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
102
   "outputs": [],
103
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
104
    "correlation(df[df[\"EndToEnd_D\"] < 500], config)"
105
106
   ]
  },
107
108
109
110
111
112
113
114
115
116
117
118
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Latency Criticality"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
119
   "metadata": {},
120
121
122
123
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
   "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"
   ]
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  }
 ],
 "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"
175
176
177
  },
  "widgets": {
   "state": {
178
    "df95aa8c42974dfeaf8e0a2c05100645": {
179
180
181
182
183
184
185
186
     "views": [
      {
       "cell_index": 6
      }
     ]
    }
   },
   "version": "1.2.0"
187
188
189
190
191
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}