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