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

Side by Side Diff: runtime/observatory/lib/src/elements/class_view.dart

Issue 1241653002: Factor cpu profile tree into separate element and expose allocation tracing UI (Closed) Base URL: git@github.com:dart-lang/sdk.git@expose_allocation_profile_service
Patch Set: Created 5 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/class_view.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library class_view_element; 5 library class_view_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'observatory_element.dart'; 8 import 'observatory_element.dart';
9 import 'package:observatory/cpu_profile.dart';
10 import 'package:observatory/elements.dart';
9 import 'package:observatory/service.dart'; 11 import 'package:observatory/service.dart';
10 import 'package:polymer/polymer.dart'; 12 import 'package:polymer/polymer.dart';
11 13
12 @CustomTag('class-view') 14 @CustomTag('class-view')
13 class ClassViewElement extends ObservatoryElement { 15 class ClassViewElement extends ObservatoryElement {
14 @published Class cls; 16 @published Class cls;
15 @observable ServiceMap instances; 17 @observable ServiceMap instances;
16 @observable int retainedBytes; 18 @observable int retainedBytes;
17 @observable ObservableList mostRetained; 19 @observable ObservableList mostRetained;
18 ClassViewElement.created() : super.created(); 20 ClassViewElement.created() : super.created();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 mostRetained = null; 56 mostRetained = null;
55 var loads = []; 57 var loads = [];
56 loads.add(cls.reload()); 58 loads.add(cls.reload());
57 cls.fields.forEach((field) => loads.add(field.reload())); 59 cls.fields.forEach((field) => loads.add(field.reload()));
58 return Future.wait(loads); 60 return Future.wait(loads);
59 } 61 }
60 62
61 Future refreshCoverage() { 63 Future refreshCoverage() {
62 return cls.refreshCoverage(); 64 return cls.refreshCoverage();
63 } 65 }
66
67 final CpuProfile profile = new CpuProfile();
68
69 Future refreshAllocationProfile() async {
70 var profileResponse = await cls.getAllocationSamples('UserVM');
71 profile.load(profileResponse.isolate, profileResponse);
72 CpuProfileTreeElement cpuProfileTreeElement =
73 shadowRoot.querySelector('#cpuProfileTree');
74 cpuProfileTreeElement.profile = profile;
75 cpuProfileTreeElement.direction = ProfileTreeDirection.Exclusive;
76 cpuProfileTreeElement.mode = ProfileTreeMode.Function;
77 cpuProfileTreeElement.render();
78 }
79
80 Future toggleAllocationTrace() {
81 if (cls == null) {
82 return new Future(refresh);
83 }
84 return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh);
85 }
64 } 86 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/class_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698