| Index: runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.dart
|
| ===================================================================
|
| --- runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.dart (revision 42293)
|
| +++ runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.dart (working copy)
|
| @@ -43,6 +43,8 @@
|
| var _classTableBody;
|
|
|
| @published ServiceMap profile;
|
| + @published bool autoRefresh = false;
|
| + var _subscription;
|
|
|
| @observable Isolate isolate;
|
|
|
| @@ -91,8 +93,22 @@
|
| _oldPieChart = new Chart('PieChart',
|
| shadowRoot.querySelector('#oldPieChart'));
|
| _classTableBody = shadowRoot.querySelector('#classTableBody');
|
| + _subscription = app.vm.events.stream.where(
|
| + (event) => event.isolate == isolate).listen(_onEvent);
|
| }
|
|
|
| + @override
|
| + void detached() {
|
| + _subscription.cancel((){});
|
| + super.detached();
|
| + }
|
| +
|
| + void _onEvent(ServiceEvent event) {
|
| + if (autoRefresh && event.eventType == 'GC') {
|
| + refresh((){});
|
| + }
|
| + }
|
| +
|
| void _updatePieCharts() {
|
| assert(profile != null);
|
| _newPieDataTable.clearRows();
|
|
|