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

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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/class_view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7ca6fb893215d4d9e2e747986ca1c58ecd3fd845 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.getAllocationSamples('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(refresh);
+ }
+ return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh);
+ }
}
« 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