Index: runtime/observatory/lib/src/elements/vm_view.dart |
diff --git a/runtime/observatory/lib/src/elements/vm_view.dart b/runtime/observatory/lib/src/elements/vm_view.dart |
index fd37dd2164666c8c21efa2ea7f00ccd69b4174fd..c02ef47a8c49b9b0861f450cc2290b48ddc37aa5 100644 |
--- a/runtime/observatory/lib/src/elements/vm_view.dart |
+++ b/runtime/observatory/lib/src/elements/vm_view.dart |
@@ -34,6 +34,7 @@ class VMViewElement extends HtmlElement implements Renderable { |
Stream<RenderedEvent<VMViewElement>> get onRendered => _r.onRendered; |
M.VM _vm; |
+ M.VMRepository _vms; |
M.EventRepository _events; |
M.NotificationRepository _notifications; |
M.IsolateRepository _isolates; |
@@ -47,17 +48,22 @@ class VMViewElement extends HtmlElement implements Renderable { |
factory VMViewElement( |
M.VM vm, |
+ M.VMRepository vms, |
M.EventRepository events, |
M.NotificationRepository notifications, |
M.IsolateRepository isolates, |
M.ScriptRepository scripts, |
{RenderingQueue queue}) { |
assert(vm != null); |
+ assert(vms != null); |
assert(events != null); |
assert(notifications != null); |
+ assert(isolates != null); |
+ assert(scripts != null); |
VMViewElement e = document.createElement(tag.name); |
e._r = new RenderingScheduler(e, queue: queue); |
e._vm = vm; |
+ e._vms = vms; |
e._events = events; |
e._notifications = notifications; |
e._isolates = isolates; |
@@ -99,13 +105,14 @@ class VMViewElement extends HtmlElement implements Renderable { |
new NavRefreshElement(queue: _r.queue) |
..onRefresh.listen((e) async { |
e.element.disabled = true; |
+ _vm = await _vms.get(_vm); |
_r.dirty(); |
}), |
new NavNotifyElement(_notifications, queue: _r.queue) |
]), |
new DivElement() |
..classes = ['content-centered-big'] |
- ..children = [ |
+ ..children = <HtmlElement>[ |
new HeadingElement.h1()..text = 'VM', |
new HRElement(), |
new DivElement() |
@@ -131,6 +138,16 @@ class VMViewElement extends HtmlElement implements Renderable { |
..classes = ['memberValue'] |
..text = _vm.version |
], |
+ new DivElement() |
+ ..classes = ['memberItem'] |
+ ..children = [ |
+ new DivElement() |
+ ..classes = ['memberName'] |
+ ..text = 'embedder', |
+ new DivElement() |
+ ..classes = ['memberValue'] |
+ ..text = _vm.embedder ?? "UNKNOWN" |
+ ], |
new DivElement() |
..classes = ['memberItem'] |
..children = [ |
@@ -179,7 +196,21 @@ class VMViewElement extends HtmlElement implements Renderable { |
..text = 'peak memory', |
new DivElement() |
..classes = ['memberValue'] |
- ..text = Utils.formatSize(_vm.maxRSS) |
+ ..text = _vm.maxRSS != null |
+ ? Utils.formatSize(_vm.maxRSS) |
+ : "unavailable" |
+ ], |
+ new DivElement() |
+ ..classes = ['memberItem'] |
+ ..children = [ |
+ new DivElement() |
+ ..classes = ['memberName'] |
+ ..text = 'current memory', |
+ new DivElement() |
+ ..classes = ['memberValue'] |
+ ..text = _vm.currentRSS != null |
+ ? Utils.formatSize(_vm.currentRSS) |
+ : "unavailable" |
], |
new DivElement() |
..classes = ['memberItem'] |
@@ -200,8 +231,12 @@ class VMViewElement extends HtmlElement implements Renderable { |
..text = 'native heap memory', |
new DivElement() |
..classes = ['memberValue'] |
- ..text = Utils.formatSize(_vm.heapAllocatedMemoryUsage) |
- ..title = '${_vm.heapAllocatedMemoryUsage} bytes' |
+ ..text = _vm.heapAllocatedMemoryUsage != null |
+ ? Utils.formatSize(_vm.heapAllocatedMemoryUsage) |
+ : 'unavailable' |
+ ..title = _vm.heapAllocatedMemoryUsage != null |
+ ? '${_vm.heapAllocatedMemoryUsage} bytes' |
+ : null |
], |
new DivElement() |
..classes = ['memberItem'] |
@@ -211,7 +246,9 @@ class VMViewElement extends HtmlElement implements Renderable { |
..text = 'native heap allocation count', |
new DivElement() |
..classes = ['memberValue'] |
- ..text = '${_vm.heapAllocationCount}' |
+ ..text = _vm.heapAllocationCount != null |
+ ? '${_vm.heapAllocationCount}' |
+ : 'unavailable' |
], |
new BRElement(), |
new DivElement() |