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

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

Issue 666913003: Add timing of serialization (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/analysis_server/lib/src/channel/channel.dart
diff --git a/pkg/analysis_server/lib/src/channel/channel.dart b/pkg/analysis_server/lib/src/channel/channel.dart
index 4e4ab2a11218dc83b9b8c23c553b24420dca998d..107b8b03e597050bbe4886a3fbc3229aab52a812 100644
--- a/pkg/analysis_server/lib/src/channel/channel.dart
+++ b/pkg/analysis_server/lib/src/channel/channel.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:convert';
import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/src/util/utilities_timing.dart';
/**
* The abstract class [ClientCommunicationChannel] defines the behavior of
@@ -45,6 +46,18 @@ abstract class ClientCommunicationChannel {
*/
abstract class ServerCommunicationChannel {
/**
+ * A stopwatch used to accumulate the amount of time spent converting
+ * incomming requests from Json to objects.
+ */
+ static final CountedStopwatch FromJson = new CountedStopwatch();
+
+ /**
+ * A stopwatch used to accumulate the amount of time spent converting outgoing
+ * responses and notifications from objects to Json.
+ */
+ static final CountedStopwatch ToJson = new CountedStopwatch();
+
+ /**
* Listen to the channel for requests. If a request is received, invoke the
* [onRequest] function. If an error is encountered while trying to read from
* the socket, invoke the [onError] function. If the socket is closed by the

Powered by Google App Engine
This is Rietveld 408576698