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

Unified Diff: runtime/bin/vmservice/observatory/lib/src/app/application.dart

Issue 429293002: Add request tracing to Observatory: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 4 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/bin/vmservice/observatory/lib/src/app/application.dart
diff --git a/runtime/bin/vmservice/observatory/lib/src/app/application.dart b/runtime/bin/vmservice/observatory/lib/src/app/application.dart
index 567422caf2968a544e7c3b31da0ef17d7961c1c8..84a5ae219a42515801db66914c6e5054c97f6b69 100644
--- a/runtime/bin/vmservice/observatory/lib/src/app/application.dart
+++ b/runtime/bin/vmservice/observatory/lib/src/app/application.dart
@@ -34,9 +34,10 @@ class ObservatoryApplication extends Observable {
_vm = vm;
}
final TargetManager targets;
- @observable Isolate isolate;
@reflectable final ObservatoryApplicationElement rootElement;
+ TraceViewElement _traceView = null;
+
@reflectable ServiceObject lastErrorOrException;
@observable ObservableList<ServiceEvent> notifications =
new ObservableList<ServiceEvent>();
@@ -125,6 +126,20 @@ class ObservatoryApplication extends Observable {
} else {
argsMap = Uri.splitQueryString(args);
}
+ if (argsMap['trace'] != null) {
+ var traceArg = argsMap['trace'];
+ if (traceArg == 'on') {
+ Tracer.start();
+ } else if (traceArg == 'off') {
+ Tracer.stop();
+ }
+ }
+ if (Tracer.current != null) {
+ Tracer.current.reset();
+ }
+ if (_traceView != null) {
+ _traceView.tracer = Tracer.current;
+ }
for (var i = 0; i < _pageRegistry.length; i++) {
var page = _pageRegistry[i];
if (page.canVisit(url)) {
@@ -157,6 +172,12 @@ class ObservatoryApplication extends Observable {
}
// Add new page.
rootElement.children.add(page.element);
+
+ // Add tracing support.
+ _traceView = new Element.tag('trace-view');
+ _traceView.tracer = Tracer.current;
+ rootElement.children.add(_traceView);
+
// Remember page.
currentPage = page;
}

Powered by Google App Engine
This is Rietveld 408576698