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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'package:charted/charted.dart'; | 7 import 'package:charted/charted.dart'; |
8 import "package:charted/charts/charts.dart"; | 8 import "package:charted/charts/charts.dart"; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 void render() { | 118 void render() { |
119 children = [ | 119 children = [ |
120 navBar([ | 120 navBar([ |
121 new NavTopMenuElement(queue: _r.queue), | 121 new NavTopMenuElement(queue: _r.queue), |
122 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 122 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
123 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), | 123 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), |
124 navMenu('allocation profile'), | 124 navMenu('allocation profile'), |
125 new NavRefreshElement( | 125 new NavRefreshElement( |
126 label: 'Download', | 126 label: 'Download', disabled: _profile == null, queue: _r.queue) |
127 disabled: _profile == null, | 127 ..onRefresh.listen((_) => _downloadCSV()), |
128 queue: _r.queue)..onRefresh.listen((_) => _downloadCSV()), | |
129 new NavRefreshElement(label: 'Reset Accumulator', queue: _r.queue) | 128 new NavRefreshElement(label: 'Reset Accumulator', queue: _r.queue) |
130 ..onRefresh.listen((_) => _refresh(reset: true)), | 129 ..onRefresh.listen((_) => _refresh(reset: true)), |
131 new NavRefreshElement(label: 'GC', queue: _r.queue) | 130 new NavRefreshElement(label: 'GC', queue: _r.queue) |
132 ..onRefresh.listen((_) => _refresh(gc: true)), | 131 ..onRefresh.listen((_) => _refresh(gc: true)), |
133 new NavRefreshElement(queue: _r.queue) | 132 new NavRefreshElement(queue: _r.queue) |
134 ..onRefresh.listen((_) => _refresh()), | 133 ..onRefresh.listen((_) => _refresh()), |
135 new DivElement() | 134 new DivElement() |
136 ..classes = ['nav-option'] | 135 ..classes = ['nav-option'] |
137 ..children = [ | 136 ..children = [ |
138 new CheckboxInputElement() | 137 new CheckboxInputElement() |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 final config = new ChartConfig(series, [0]) | 556 final config = new ChartConfig(series, [0]) |
558 ..minimumSize = minSize | 557 ..minimumSize = minSize |
559 ..legend = new ChartLegend(legend, showValues: true); | 558 ..legend = new ChartLegend(legend, showValues: true); |
560 final data = new ChartData(_columns, [ | 559 final data = new ChartData(_columns, [ |
561 ['Used', space.used], | 560 ['Used', space.used], |
562 ['Free', space.capacity - space.used], | 561 ['Free', space.capacity - space.used], |
563 ['External', space.external] | 562 ['External', space.external] |
564 ]); | 563 ]); |
565 | 564 |
566 new LayoutArea(host, data, config, | 565 new LayoutArea(host, data, config, |
567 state: new ChartState(), autoUpdate: true)..draw(); | 566 state: new ChartState(), autoUpdate: true) |
| 567 ..draw(); |
568 } | 568 } |
569 | 569 |
570 Future _refresh({bool gc: false, bool reset: false}) async { | 570 Future _refresh({bool gc: false, bool reset: false}) async { |
571 _profile = null; | 571 _profile = null; |
572 _r.dirty(); | 572 _r.dirty(); |
573 _profile = await _repository.get(_isolate, gc: gc, reset: reset); | 573 _profile = await _repository.get(_isolate, gc: gc, reset: reset); |
574 _r.dirty(); | 574 _r.dirty(); |
575 } | 575 } |
576 | 576 |
577 void _downloadCSV() { | 577 void _downloadCSV() { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 static int _getNewCurrentInstances(M.ClassHeapStats s) => | 637 static int _getNewCurrentInstances(M.ClassHeapStats s) => |
638 s.newSpace.current.instances; | 638 s.newSpace.current.instances; |
639 static int _getOldAccumulatedSize(M.ClassHeapStats s) => | 639 static int _getOldAccumulatedSize(M.ClassHeapStats s) => |
640 s.oldSpace.accumulated.bytes; | 640 s.oldSpace.accumulated.bytes; |
641 static int _getOldAccumulatedInstances(M.ClassHeapStats s) => | 641 static int _getOldAccumulatedInstances(M.ClassHeapStats s) => |
642 s.oldSpace.accumulated.instances; | 642 s.oldSpace.accumulated.instances; |
643 static int _getOldCurrentSize(M.ClassHeapStats s) => s.oldSpace.current.bytes; | 643 static int _getOldCurrentSize(M.ClassHeapStats s) => s.oldSpace.current.bytes; |
644 static int _getOldCurrentInstances(M.ClassHeapStats s) => | 644 static int _getOldCurrentInstances(M.ClassHeapStats s) => |
645 s.oldSpace.current.instances; | 645 s.oldSpace.current.instances; |
646 } | 646 } |
OLD | NEW |