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

Unified Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 2717253002: Add instrumentation data to the analysis server diagnostics page. (Closed)
Patch Set: Created 3 years, 10 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: pkg/analyzer/lib/instrumentation/instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index abc2799315e8927bd90df7a6999f164dedddb0e3..6a89b8e53bb166cfc32e98624c7159cd714fe199 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -28,6 +28,11 @@ abstract class InstrumentationServer {
String get sessionId;
/**
+ * A user-friendly description of this instrumentation server.
+ */
+ String get describe => '${toString()}, session $sessionId';
Brian Wilkerson 2017/02/27 14:41:32 Personally, I would create a method other than `to
devoncarew 2017/03/01 01:51:32 I changed this to a purely abstract method (String
+
+ /**
* Pass the given [message] to the instrumentation server so that it will be
* logged with other messages.
*
@@ -110,6 +115,8 @@ class InstrumentationService {
*/
String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString();
+ InstrumentationServer get instrumentationServer => _instrumentationServer;
+
/**
* Log that the given analysis [task] is being performed in the given
* [context].
@@ -370,6 +377,13 @@ class MulticastInstrumentationServer implements InstrumentationServer {
String get sessionId => _servers[0].sessionId;
@override
+ String get describe {
+ return _servers
+ .map((InstrumentationServer server) => server.describe)
+ .join("\n");
+ }
+
+ @override
void log(String message) {
for (InstrumentationServer server in _servers) {
server.log(message);

Powered by Google App Engine
This is Rietveld 408576698