OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library isolate_profile_element; | 5 library isolate_profile_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 var period = profile['period']; | 120 var period = profile['period']; |
121 sampleRate = (MICROSECONDS_PER_SECOND / period).toStringAsFixed(0); | 121 sampleRate = (MICROSECONDS_PER_SECOND / period).toStringAsFixed(0); |
122 timeSpan = formatTime(profile['timeSpan']); | 122 timeSpan = formatTime(profile['timeSpan']); |
123 displayCutoff = '${(displayThreshold * 100.0).toString()}%'; | 123 displayCutoff = '${(displayThreshold * 100.0).toString()}%'; |
124 profile.isolate.processProfile(profile); | 124 profile.isolate.processProfile(profile); |
125 profile['threshold'] = displayThreshold; | 125 profile['threshold'] = displayThreshold; |
126 _update(); | 126 _update(); |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 void enteredView() { | 130 @override |
| 131 void attached() { |
| 132 super.attached(); |
131 tree = new TableTree(); | 133 tree = new TableTree(); |
132 _update(); | 134 _update(); |
133 } | 135 } |
134 | 136 |
135 void tagSelectorChanged(oldValue) { | 137 void tagSelectorChanged(oldValue) { |
136 refresh(null); | 138 refresh(null); |
137 } | 139 } |
138 | 140 |
139 void refresh(var done) { | 141 void refresh(var done) { |
140 var request = 'profile?tags=$tagSelector'; | 142 var request = 'profile?tags=$tagSelector'; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 if (row is TableRowElement) { | 201 if (row is TableRowElement) { |
200 // Subtract 1 to get 0 based indexing. | 202 // Subtract 1 to get 0 based indexing. |
201 try { | 203 try { |
202 tree.toggle(row.rowIndex - 1); | 204 tree.toggle(row.rowIndex - 1); |
203 } catch (e, stackTrace) { | 205 } catch (e, stackTrace) { |
204 Logger.root.warning('toggleExpanded', e, stackTrace); | 206 Logger.root.warning('toggleExpanded', e, stackTrace); |
205 } | 207 } |
206 } | 208 } |
207 } | 209 } |
208 } | 210 } |
OLD | NEW |