| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 heap_profile_element; | 5 library heap_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:observatory/service.dart'; | 9 import 'package:observatory/service.dart'; |
| 10 import 'package:logging/logging.dart'; | 10 import 'package:logging/logging.dart'; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 _combinedTableColumnValue(cls, 2), | 126 _combinedTableColumnValue(cls, 2), |
| 127 _combinedTableColumnValue(cls, 3), | 127 _combinedTableColumnValue(cls, 3), |
| 128 _combinedTableColumnValue(cls, 4), | 128 _combinedTableColumnValue(cls, 4), |
| 129 _combinedTableColumnValue(cls, 5), | 129 _combinedTableColumnValue(cls, 5), |
| 130 _combinedTableColumnValue(cls, 6)]); | 130 _combinedTableColumnValue(cls, 6)]); |
| 131 } | 131 } |
| 132 _newPieDataTable.clearRows(); | 132 _newPieDataTable.clearRows(); |
| 133 var heap = profile['heaps']['new']; | 133 var heap = profile['heaps']['new']; |
| 134 _newPieDataTable.addRow(['Used', heap['used']]); | 134 _newPieDataTable.addRow(['Used', heap['used']]); |
| 135 _newPieDataTable.addRow(['Free', heap['capacity'] - heap['used']]); | 135 _newPieDataTable.addRow(['Free', heap['capacity'] - heap['used']]); |
| 136 _newPieDataTable.addRow(['External', heap['external']]); |
| 136 _oldPieDataTable.clearRows(); | 137 _oldPieDataTable.clearRows(); |
| 137 heap = profile['heaps']['old']; | 138 heap = profile['heaps']['old']; |
| 138 _oldPieDataTable.addRow(['Used', heap['used']]); | 139 _oldPieDataTable.addRow(['Used', heap['used']]); |
| 139 _oldPieDataTable.addRow(['Free', heap['capacity'] - heap['used']]); | 140 _oldPieDataTable.addRow(['Free', heap['capacity'] - heap['used']]); |
| 141 _oldPieDataTable.addRow(['External', heap['external']]); |
| 140 _draw(); | 142 _draw(); |
| 141 } | 143 } |
| 142 | 144 |
| 143 void _draw() { | 145 void _draw() { |
| 144 if ((_fullChart == null) || (_combinedChart == null)) { | 146 if ((_fullChart == null) || (_combinedChart == null)) { |
| 145 return; | 147 return; |
| 146 } | 148 } |
| 147 _combinedChart.refreshOptionsSortInfo(); | 149 _combinedChart.refreshOptionsSortInfo(); |
| 148 _combinedChart.draw(_combinedDataTable); | 150 _combinedChart.draw(_combinedDataTable); |
| 149 _fullChart.refreshOptionsSortInfo(); | 151 _fullChart.refreshOptionsSortInfo(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 278 |
| 277 @observable String formattedTotalCollectionTime(bool newSpace) { | 279 @observable String formattedTotalCollectionTime(bool newSpace) { |
| 278 if (profile == null) { | 280 if (profile == null) { |
| 279 return ''; | 281 return ''; |
| 280 } | 282 } |
| 281 String space = newSpace ? 'new' : 'old'; | 283 String space = newSpace ? 'new' : 'old'; |
| 282 Map heap = profile['heaps'][space]; | 284 Map heap = profile['heaps'][space]; |
| 283 return '${formatSeconds(heap['time'])} secs'; | 285 return '${formatSeconds(heap['time'])} secs'; |
| 284 } | 286 } |
| 285 } | 287 } |
| OLD | NEW |