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

Unified Diff: pkg/analysis_server/lib/src/channel/byte_stream_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/http_server.dart ('k') | pkg/analysis_server/lib/src/channel/channel.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/byte_stream_channel.dart
diff --git a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
index 2953701525d1a2f54fc159b5039bf9b825cc99e4..0fba1fbb0596cb293cc62ef49a1932fceea8655c 100644
--- a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/byte_stream_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';
/**
* Instances of the class [ByteStreamClientChannel] implement a
@@ -87,6 +88,11 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
final IOSink _output;
/**
+ * The instrumentation server that is to be used by this analysis server.
+ */
+ final InstrumentationServer instrumentationServer;
+
+ /**
* Completer that will be signalled when the input stream is closed.
*/
final Completer _closed = new Completer();
@@ -107,7 +113,7 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
*/
bool _closeRequested = false;
- ByteStreamServerChannel(this.input, this._output);
+ ByteStreamServerChannel(this.input, this._output, this.instrumentationServer);
/**
* Future that will be completed when the input stream is closed.
@@ -155,6 +161,7 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
String jsonEncoding = JSON.encode(notification.toJson());
ServerCommunicationChannel.ToJson.stop();
_outputLine(jsonEncoding);
+ instrumentationServer.log(jsonEncoding);
}
@override
@@ -168,6 +175,7 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
String jsonEncoding = JSON.encode(response.toJson());
ServerCommunicationChannel.ToJson.stop();
_outputLine(jsonEncoding);
+ instrumentationServer.log(jsonEncoding);
}
/**
@@ -225,6 +233,7 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
if (_closed.isCompleted) {
return;
}
+ instrumentationServer.log(data);
// Parse the string as a JSON descriptor and process the resulting
// structure as a request.
ServerCommunicationChannel.FromJson.start();
« no previous file with comments | « pkg/analysis_server/lib/http_server.dart ('k') | pkg/analysis_server/lib/src/channel/channel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698