OLD | NEW |
1 <link rel="import" href="../../../../packages/polymer/polymer.html"> | 1 <link rel="import" href="../../../../packages/polymer/polymer.html"> |
2 <link rel="import" href="code_ref.html"> | 2 <link rel="import" href="code_ref.html"> |
3 <link rel="import" href="function_ref.html"> | 3 <link rel="import" href="function_ref.html"> |
4 <link rel="import" href="nav_bar.html"> | 4 <link rel="import" href="nav_bar.html"> |
5 <link rel="import" href="observatory_element.html"> | 5 <link rel="import" href="observatory_element.html"> |
6 <link rel="import" href="sliding_checkbox.html"> | 6 <link rel="import" href="sliding_checkbox.html"> |
7 | 7 |
| 8 <polymer-element name="cpu-profile-table" extends="observatory-element"> |
| 9 <template> |
| 10 <link rel="stylesheet" href="css/shared.css"> |
| 11 <nav-bar> |
| 12 <top-nav-menu></top-nav-menu> |
| 13 <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu> |
| 14 <nav-menu link="{{ makeLink('/profiler-table', isolate) }}" anchor="cpu pr
ofile (table)" last="{{ true }}"></nav-menu> |
| 15 <nav-refresh callback="{{ refresh }}"></nav-refresh> |
| 16 <nav-refresh callback="{{ clear }}" label="Clear"></nav-refresh> |
| 17 </nav-bar> |
| 18 <style> |
| 19 /* general */ |
| 20 .well { |
| 21 background-color: #ECECEC; |
| 22 padding: 0.2em; |
| 23 } |
| 24 .center { |
| 25 align-items: center; |
| 26 justify-content: center; |
| 27 } |
| 28 |
| 29 /* status messages */ |
| 30 .statusMessage { |
| 31 font-size: 150%; |
| 32 font-weight: bold; |
| 33 } |
| 34 .statusBox { |
| 35 height: 100%; |
| 36 padding: 1em; |
| 37 } |
| 38 |
| 39 /* tables */ |
| 40 .table { |
| 41 border-collapse: collapse!important; |
| 42 table-layout: fixed; |
| 43 height: 100%; |
| 44 } |
| 45 .th, .td { |
| 46 padding: 8px; |
| 47 vertical-align: top; |
| 48 } |
| 49 .table thead > tr > th { |
| 50 vertical-align: bottom; |
| 51 text-align: left; |
| 52 border-bottom:2px solid #ddd; |
| 53 } |
| 54 .spacer { |
| 55 width: 16px; |
| 56 } |
| 57 .left-border-spacer { |
| 58 width: 16px; |
| 59 border-left: 1px solid; |
| 60 } |
| 61 .clickable { |
| 62 color: #0489c3; |
| 63 text-decoration: none; |
| 64 cursor: pointer; |
| 65 min-width: 8em; |
| 66 } |
| 67 .clickable:hover { |
| 68 text-decoration: underline; |
| 69 cursor: pointer; |
| 70 } |
| 71 tr:hover:not(.focused) > td { |
| 72 background-color: #FAFAFA; |
| 73 } |
| 74 .focused { |
| 75 background-color: #F4C7C3; |
| 76 } |
| 77 .scroll { |
| 78 overflow: scroll; |
| 79 } |
| 80 .outlined { |
| 81 -webkit-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 82 -moz-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 83 box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 84 margin: 4px; |
| 85 } |
| 86 .centered { |
| 87 margin-left: auto; |
| 88 margin-right: auto; |
| 89 justify-content: center; |
| 90 } |
| 91 .full-height { |
| 92 height: 100%; |
| 93 } |
| 94 .mostly-full-height { |
| 95 height: 80%; |
| 96 } |
| 97 .full-width { |
| 98 width: 100%; |
| 99 } |
| 100 .focused-function-label { |
| 101 flex: 0 1 auto; |
| 102 margin-left: auto; |
| 103 margin-right: auto; |
| 104 justify-content: center; |
| 105 } |
| 106 .call-table { |
| 107 flex: 1 1 auto; |
| 108 } |
| 109 |
| 110 .tree { |
| 111 border-spacing: 0px; |
| 112 width: 100%; |
| 113 margin-bottom: 20px |
| 114 vertical-align: middle; |
| 115 } |
| 116 |
| 117 .tree tbody tr { |
| 118 animation: fadeIn 0.5s; |
| 119 -moz-animation: fadeIn 0.5s; |
| 120 -webkit-animation: fadeIn 0.5s; |
| 121 } |
| 122 |
| 123 .tree tbody tr:hover { |
| 124 background-color: #FAFAFA; |
| 125 } |
| 126 |
| 127 .tree tr td:first-child, |
| 128 .tree tr th:first-child { |
| 129 width: 100%; |
| 130 } |
| 131 |
| 132 .tree thead > tr > th { |
| 133 padding: 8px; |
| 134 vertical-align: bottom; |
| 135 text-align: left; |
| 136 border-bottom: 1px solid #ddd; |
| 137 } |
| 138 |
| 139 </style> |
| 140 <div class="content-centered-big"> |
| 141 <template if="{{ state == 'Requested' }}"> |
| 142 <div class="statusBox shadow center"> |
| 143 <div class="statusMessage">Fetching profile from VM...</div> |
| 144 </div> |
| 145 </template> |
| 146 <template if="{{ state == 'Loading' }}"> |
| 147 <div class="statusBox shadow center"> |
| 148 <div class="statusMessage">Loading profile...</div> |
| 149 </div> |
| 150 </template> |
| 151 <template if="{{ state == 'Exception' }}"> |
| 152 <div class="statusBox shadow center"> |
| 153 <div class="statusMessage"> |
| 154 <h1>Exception:</h1> |
| 155 <br> |
| 156 <pre>{{ exception.toString() }}</pre> |
| 157 <br> |
| 158 <h1>Stack trace:</h1> |
| 159 <br> |
| 160 <pre>{{ stackTrace.toString() }}</pre> |
| 161 </div> |
| 162 </div> |
| 163 </template> |
| 164 <template if="{{ state == 'Loaded' }}"> |
| 165 <div class="memberList"> |
| 166 <div class="memberItem"> |
| 167 <div class="memberName">Refreshed at </div> |
| 168 <div class="memberValue">{{ refreshTime }} (fetched in {{ fetchTime
}}) (loaded in {{ loadTime }})</div> |
| 169 </div> |
| 170 <div class="memberItem"> |
| 171 <div class="memberName">Profile contains</div> |
| 172 <div class="memberValue">{{ sampleCount }} samples (spanning {{ time
Span }})</div> |
| 173 </div> |
| 174 <div class="memberItem"> |
| 175 <div class="memberName">Sampling</div> |
| 176 <div class="memberValue">{{ stackDepth }} stack frames @ {{ sampleRa
te }} Hz</div> |
| 177 </div> |
| 178 <div class="memberItem"> |
| 179 <div class="memberName">Call Tree Direction</div> |
| 180 <div class="memberValue"> |
| 181 <select value="{{directionSelector}}"> |
| 182 <option value="Down">Top down</option> |
| 183 <option value="Up">Bottom up</option> |
| 184 </select> |
| 185 </div> |
| 186 </div> |
| 187 </div> |
| 188 </template> |
| 189 </div> |
| 190 <hr> |
| 191 <div id="main" class="flex-row centered"> |
| 192 <div class="flex-item-45-percent full-height outlined scroll"> |
| 193 <table id="main-table" class="flex-item-100-percent table"> |
| 194 <thead> |
| 195 <tr> |
| 196 <th on-click="{{changeSortProfile}}" class="clickable" title="Execut
ing (%)">{{ profileTable.getColumnLabel(0) }}</th> |
| 197 <th on-click="{{changeSortProfile}}" class="clickable" title="In sta
ck (%)">{{ profileTable.getColumnLabel(1) }}</th> |
| 198 <th on-click="{{changeSortProfile}}" class="clickable" title="Method
">{{ profileTable.getColumnLabel(2) }}</th> |
| 199 </tr> |
| 200 </thead> |
| 201 <tbody id="profile-table"> |
| 202 </tbody> |
| 203 </table> |
| 204 </div> |
| 205 <div class="flex-item-45-percent full-height outlined"> |
| 206 <div class="flex-column full-height"> |
| 207 <div class="focused-function-label"> |
| 208 <template if="{{ focusedFunction != null }}"> |
| 209 <span>Focused on: </span> |
| 210 <function-ref ref="{{ focusedFunction }}"></function-ref> |
| 211 </template> |
| 212 <template if="{{ focusedFunction == null }}"> |
| 213 <span>No focused function</span> |
| 214 </template> |
| 215 </div> |
| 216 <hr> |
| 217 <div class="call-table scroll"> |
| 218 <table class="full-width table"> |
| 219 <thead> |
| 220 <tr> |
| 221 <th on-click="{{changeSortCallers}}" class="clickable" title="Ca
llers (%)">{{ profileCallersTable.getColumnLabel(0) }}</th> |
| 222 <th on-click="{{changeSortCallers}}" class="clickable" title="Me
thod">{{ profileCallersTable.getColumnLabel(1) }}</th> |
| 223 </tr> |
| 224 </thead> |
| 225 <tbody id="callers-table"> |
| 226 </tbody> |
| 227 </table> |
| 228 </div> |
| 229 <hr> |
| 230 <div class="call-table scroll"> |
| 231 <table class="full-width table"> |
| 232 <thead> |
| 233 <tr> |
| 234 <th on-click="{{changeSortCallees}}" class="clickable" title="Ca
llees (%)">{{ profileCalleesTable.getColumnLabel(0) }}</th> |
| 235 <th on-click="{{changeSortCallees}}" class="clickable" title="Me
thod">{{ profileCalleesTable.getColumnLabel(1) }}</th> |
| 236 </tr> |
| 237 </thead> |
| 238 <tbody id="callees-table"> |
| 239 </tbody> |
| 240 </table> |
| 241 </div> |
| 242 </div> |
| 243 </div> |
| 244 </div> |
| 245 <br> |
| 246 <br> |
| 247 <div class="focused-function-label"> |
| 248 <template if="{{ focusedFunction != null }}"> |
| 249 <span>Filtered tree: </span> |
| 250 <function-ref ref="{{ focusedFunction }}"></function-ref> |
| 251 </template> |
| 252 <template if="{{ focusedFunction == null }}"> |
| 253 <span>No focused function</span> |
| 254 </template> |
| 255 </div> |
| 256 <div class="flex-row centered"> |
| 257 <div class="flex-item-90-percent outlined" style="margin: 16px; margin-lef
t: 8px; margin-right: 8px"> |
| 258 <table class="full-width tree"> |
| 259 <thead id="treeHeader"> |
| 260 <tr> |
| 261 <th>Method</th> |
| 262 <th>Executing</th> |
| 263 </tr> |
| 264 </thead> |
| 265 <tbody id="treeBody"> |
| 266 </tbody> |
| 267 </table> |
| 268 </div> |
| 269 </div> |
| 270 </template> |
| 271 </polymer-element> |
| 272 |
8 <polymer-element name="cpu-profile" extends="observatory-element"> | 273 <polymer-element name="cpu-profile" extends="observatory-element"> |
9 <template> | 274 <template> |
10 <link rel="stylesheet" href="css/shared.css"> | 275 <link rel="stylesheet" href="css/shared.css"> |
11 <nav-bar> | 276 <nav-bar> |
12 <top-nav-menu></top-nav-menu> | 277 <top-nav-menu></top-nav-menu> |
13 <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu> | 278 <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu> |
14 <nav-menu link="{{ makeLink('/profiler', isolate) }}" anchor="cpu profile"
last="{{ true }}"></nav-menu> | 279 <nav-menu link="{{ makeLink('/profiler', isolate) }}" anchor="cpu profile"
last="{{ true }}"></nav-menu> |
15 <nav-refresh callback="{{ refresh }}"></nav-refresh> | 280 <nav-refresh callback="{{ refresh }}"></nav-refresh> |
16 <nav-refresh callback="{{ clear }}" label="Clear"></nav-refresh> | 281 <nav-refresh callback="{{ clear }}" label="Clear"></nav-refresh> |
17 <nav-control></nav-control> | |
18 </nav-bar> | 282 </nav-bar> |
19 <style> | 283 <style> |
20 .tableWell { | 284 .tableWell { |
21 background-color: #ECECEC; | 285 background-color: #ECECEC; |
22 padding: 0.2em; | 286 padding: 0.2em; |
23 } | 287 } |
24 | 288 |
25 .table { | 289 .table { |
26 border-spacing: 0px; | 290 border-spacing: 0px; |
27 width: 100%; | 291 width: 100%; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 <br> | 449 <br> |
186 <div>Child nodes are callers.</div> | 450 <div>Child nodes are callers.</div> |
187 </div> | 451 </div> |
188 </template> | 452 </template> |
189 <br><br> | 453 <br><br> |
190 <div class="tableWell shadow"> | 454 <div class="tableWell shadow"> |
191 <table class="table"> | 455 <table class="table"> |
192 <thead id="treeHeader"> | 456 <thead id="treeHeader"> |
193 <tr> | 457 <tr> |
194 <th>Method</th> | 458 <th>Method</th> |
195 <th>Self</th> | 459 <th>Executing</th> |
196 </tr> | 460 </tr> |
197 </thead> | 461 </thead> |
198 <tbody id="treeBody"> | 462 <tbody id="treeBody"> |
199 </tbody> | 463 </tbody> |
200 </table> | 464 </table> |
201 </div> | 465 </div> |
202 </div> | 466 </div> |
203 </template> | 467 </template> |
204 </polymer-element> | 468 </polymer-element> |
205 | 469 |
206 <script type="application/dart" src="cpu_profile.dart"></script> | 470 <script type="application/dart" src="cpu_profile.dart"></script> |
OLD | NEW |