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

Unified Diff: pkg/analysis_server/lib/src/channel/web_socket_channel.dart

Issue 790063002: Instrument communications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | « pkg/analysis_server/lib/src/channel/channel.dart ('k') | pkg/analysis_server/lib/stdio_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/channel/web_socket_channel.dart
diff --git a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
index 8dfcb5c552ff294ac1871a1ec676217f3e2bee8c..dce402e91fd61ba6b65d2bf072afda36b5ace170 100644
--- a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
@@ -10,6 +10,7 @@ import 'dart:io';
import 'package:analysis_server/src/channel/channel.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/instrumentation/instrumentation.dart';
/**
@@ -72,9 +73,14 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
final WebSocket socket;
/**
+ * The instrumentation server that is to be used by this analysis server.
+ */
+ final InstrumentationServer instrumentationServer;
+
+ /**
* Initialize a newly create [WebSocket] wrapper to wrap the given [socket].
*/
- WebSocketServerChannel(this.socket);
+ WebSocketServerChannel(this.socket, this.instrumentationServer);
@override
void close() {
@@ -96,6 +102,7 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
*/
void readRequest(Object data, void onRequest(Request request)) {
if (data is String) {
+ instrumentationServer.log(data);
// Parse the string as a JSON descriptor and process the resulting
// structure as a request.
ServerCommunicationChannel.FromJson.start();
@@ -120,6 +127,7 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
String jsonEncoding = JSON.encode(notification.toJson());
ServerCommunicationChannel.ToJson.stop();
socket.add(jsonEncoding);
+ instrumentationServer.log(jsonEncoding);
}
@override
@@ -128,5 +136,6 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
String jsonEncoding = JSON.encode(response.toJson());
ServerCommunicationChannel.ToJson.stop();
socket.add(jsonEncoding);
+ instrumentationServer.log(jsonEncoding);
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/channel/channel.dart ('k') | pkg/analysis_server/lib/stdio_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698