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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/elements/class_view.dart
diff --git a/runtime/observatory/lib/src/elements/class_view.dart b/runtime/observatory/lib/src/elements/class_view.dart
index d839614fa7afbc647dcd35d11e46bfa45303ee46..6da96ca2c726458ef78959e940b54b2d042bd7e2 100644
--- a/runtime/observatory/lib/src/elements/class_view.dart
+++ b/runtime/observatory/lib/src/elements/class_view.dart
@@ -6,6 +6,8 @@ library class_view_element;
import 'dart:async';
import 'observatory_element.dart';
+import 'package:observatory/cpu_profile.dart';
+import 'package:observatory/elements.dart';
import 'package:observatory/service.dart';
import 'package:polymer/polymer.dart';
@@ -61,4 +63,24 @@ class ClassViewElement extends ObservatoryElement {
Future refreshCoverage() {
return cls.refreshCoverage();
}
+
+ final CpuProfile profile = new CpuProfile();
+
+ Future refreshAllocationProfile() async {
+ var profileResponse = await cls.getAllocationProfile('UserVM');
+ profile.load(profileResponse.isolate, profileResponse);
+ CpuProfileTreeElement cpuProfileTreeElement =
+ shadowRoot.querySelector('#cpuProfileTree');
+ cpuProfileTreeElement.profile = profile;
+ cpuProfileTreeElement.direction = ProfileTreeDirection.Exclusive;
+ cpuProfileTreeElement.mode = ProfileTreeMode.Function;
+ cpuProfileTreeElement.render();
+ }
+
+ Future toggleAllocationTrace() {
+ if (cls == null) {
+ return new Future.value(null).whenComplete(refresh);
rmacnak 2015/07/14 17:20:29 new Future(refresh)
Cutch 2015/07/14 20:02:57 Done.
+ }
+ return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698