Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Unified Diff: runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.dart

Issue 798563003: observatory: optionally auto-refresh allocation profile page at each GC. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | runtime/bin/vmservice/observatory/lib/src/elements/heap_profile.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698