| Index: runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart
|
| diff --git a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart
|
| index 6c4b257bdc174365333f190dafffd34bd8048b15..7617a20da4ada1bc6083171d19f10695b4699cf2 100644
|
| --- a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart
|
| +++ b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart
|
| @@ -7,7 +7,7 @@ import 'dart:html';
|
| import 'dart:math' as Math;
|
| import 'package:observatory/models.dart' as M;
|
| import 'package:observatory/src/elements/stack_trace_tree_config.dart'
|
| - show ProfileTreeMode;
|
| + show ProfileTreeMode;
|
| import 'package:observatory/src/elements/code_ref.dart';
|
| import 'package:observatory/src/elements/containers/virtual_tree.dart';
|
| import 'package:observatory/src/elements/function_ref.dart';
|
| @@ -16,7 +16,7 @@ import 'package:observatory/src/elements/helpers/tag.dart';
|
| import 'package:observatory/utils.dart';
|
|
|
| export 'package:observatory/src/elements/stack_trace_tree_config.dart'
|
| - show ProfileTreeMode;
|
| + show ProfileTreeMode;
|
|
|
| class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| static const tag =
|
| @@ -25,7 +25,7 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| RenderingScheduler<CpuProfileVirtualTreeElement> _r;
|
|
|
| Stream<RenderedEvent<CpuProfileVirtualTreeElement>> get onRendered =>
|
| - _r.onRendered;
|
| + _r.onRendered;
|
|
|
| M.ProfileTreeDirection _direction;
|
| ProfileTreeMode _mode;
|
| @@ -47,8 +47,9 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| _r.dirty();
|
| }
|
|
|
| - factory CpuProfileVirtualTreeElement(M.IsolateRef isolate,
|
| - M.SampleProfile profile, {ProfileTreeMode mode: ProfileTreeMode.function,
|
| + factory CpuProfileVirtualTreeElement(
|
| + M.IsolateRef isolate, M.SampleProfile profile,
|
| + {ProfileTreeMode mode: ProfileTreeMode.function,
|
| M.ProfileTreeDirection direction: M.ProfileTreeDirection.exclusive,
|
| RenderingQueue queue}) {
|
| assert(isolate != null);
|
| @@ -72,7 +73,7 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| _r.enable();
|
| }
|
|
|
| - @override
|
| + @override
|
| detached() {
|
| super.detached();
|
| _r.disable(notify: true);
|
| @@ -102,13 +103,11 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| });
|
| }
|
| if (tree == null) {
|
| - children = [
|
| - new HeadingElement.h1()..text = 'No Results'
|
| - ];
|
| + children = [new HeadingElement.h1()..text = 'No Results'];
|
| return;
|
| }
|
| _tree = new VirtualTreeElement(_createRow, update, _getChildren,
|
| - items: tree.root.children, queue: _r.queue);
|
| + items: tree.root.children, queue: _r.queue);
|
| if (tree.root.children.length == 1) {
|
| _tree.expand(tree.root.children.first, autoExpandSingleChildNodes: true);
|
| }
|
| @@ -119,14 +118,18 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
| return new DivElement()
|
| ..classes = ['tree-item']
|
| ..children = [
|
| - new SpanElement()..classes = ['inclusive']
|
| + new SpanElement()
|
| + ..classes = ['inclusive']
|
| ..title = 'global % on stack',
|
| - new SpanElement()..classes = ['exclusive']
|
| + new SpanElement()
|
| + ..classes = ['exclusive']
|
| ..title = 'global % executing',
|
| new SpanElement()..classes = ['lines'],
|
| - new ButtonElement()..classes = ['expander']
|
| + new ButtonElement()
|
| + ..classes = ['expander']
|
| ..onClick.listen((_) => toggle(autoToggleSingleChildNodes: true)),
|
| - new SpanElement()..classes = ['percentage']
|
| + new SpanElement()
|
| + ..classes = ['percentage']
|
| ..title = 'tree node %',
|
| new SpanElement()..classes = ['name']
|
| ];
|
| @@ -134,41 +137,38 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable {
|
|
|
| static _getChildren(M.CallTreeNode node) => node.children;
|
|
|
| - void _updateFunctionRow(HtmlElement element, M.FunctionCallTreeNode item,
|
| - int depth) {
|
| - element.children[0].text = Utils.formatPercentNormalized(
|
| - item.profileFunction.normalizedInclusiveTicks);
|
| - element.children[1].text = Utils.formatPercentNormalized(
|
| - item.profileFunction.normalizedExclusiveTicks);
|
| + void _updateFunctionRow(
|
| + HtmlElement element, M.FunctionCallTreeNode item, int depth) {
|
| + element.children[0].text = Utils
|
| + .formatPercentNormalized(item.profileFunction.normalizedInclusiveTicks);
|
| + element.children[1].text = Utils
|
| + .formatPercentNormalized(item.profileFunction.normalizedExclusiveTicks);
|
| _updateLines(element.children[2].children, depth);
|
| if (item.children.isNotEmpty) {
|
| element.children[3].text = _tree.isExpanded(item) ? '▼' : '►';
|
| } else {
|
| element.children[3].text = '';
|
| }
|
| - element.children[4].text = Utils.formatPercentNormalized(
|
| - item.percentage);
|
| - element.children[5] = new FunctionRefElement(_isolate,
|
| - item.profileFunction.function, queue: _r.queue)
|
| - ..classes = ['name'];
|
| + element.children[4].text = Utils.formatPercentNormalized(item.percentage);
|
| + element.children[5] = new FunctionRefElement(
|
| + _isolate, item.profileFunction.function, queue: _r.queue)
|
| + ..classes = ['name'];
|
| }
|
|
|
| void _updateCodeRow(HtmlElement element, M.CodeCallTreeNode item, int depth) {
|
| - element.children[0].text = Utils.formatPercentNormalized(
|
| - item.profileCode.normalizedInclusiveTicks);
|
| - element.children[1].text = Utils.formatPercentNormalized(
|
| - item.profileCode.normalizedExclusiveTicks);
|
| + element.children[0].text = Utils
|
| + .formatPercentNormalized(item.profileCode.normalizedInclusiveTicks);
|
| + element.children[1].text = Utils
|
| + .formatPercentNormalized(item.profileCode.normalizedExclusiveTicks);
|
| _updateLines(element.children[2].children, depth);
|
| if (item.children.isNotEmpty) {
|
| element.children[3].text = _tree.isExpanded(item) ? '▼' : '►';
|
| } else {
|
| element.children[3].text = '';
|
| }
|
| - element.children[4].text = Utils.formatPercentNormalized(
|
| - item.percentage);
|
| - element.children[5] = new CodeRefElement(_isolate,
|
| - item.profileCode.code, queue: _r.queue)
|
| - ..classes = ['name'];
|
| + element.children[4].text = Utils.formatPercentNormalized(item.percentage);
|
| + element.children[5] = new CodeRefElement(_isolate, item.profileCode.code,
|
| + queue: _r.queue)..classes = ['name'];
|
| }
|
|
|
| static _updateLines(List<Element> lines, int n) {
|
|
|