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

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

Issue 918383002: Rework analysis server performance measurement code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/get_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index f5430ac3b9bd476c9657825d52d4f0c279dc5d11..397390b91a8b5769eed5bd7f09b2997c356affb2 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -28,6 +28,7 @@ import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
typedef void OptionUpdater(AnalysisOptionsImpl options);
@@ -669,6 +670,7 @@ class AnalysisServer {
*/
void performOperation() {
assert(performOperationPending);
+ PerformanceTag.UNKNOWN.makeCurrent();
performOperationPending = false;
if (!running) {
// An error has occurred, or the connection to the client has been
@@ -683,6 +685,7 @@ class AnalysisServer {
// This can happen if the operation queue is cleared while the operation
// loop is in progress. No problem; we just need to exit the operation
// loop and wait for the next operation to be added.
+ ServerPerformanceStatistics.idle.makeCurrent();
return;
}
sendStatusNotification(operation);
@@ -700,6 +703,7 @@ class AnalysisServer {
shutdown();
} finally {
if (!operationQueue.isEmpty) {
+ ServerPerformanceStatistics.intertask.makeCurrent();
_schedulePerformOperation();
} else {
sendStatusNotification(null);
@@ -707,6 +711,7 @@ class AnalysisServer {
_onAnalysisCompleteCompleter.complete();
_onAnalysisCompleteCompleter = null;
}
+ ServerPerformanceStatistics.idle.makeCurrent();
}
}
}
@@ -1244,6 +1249,41 @@ class ServerContextManager extends ContextManager {
/**
+ * Container with global [AnalysisServer] performance statistics.
+ */
+class ServerPerformanceStatistics {
+ /**
+ * The [PerformanceTag] for time spent in
+ * PerformAnalysisOperation._updateIndex.
+ */
+ static PerformanceTag index = new PerformanceTag('index');
+
+ /**
+ * The [PerformanceTag] for time spent in
+ * PerformAnalysisOperation._sendNotices.
+ */
+ static PerformanceTag notices = new PerformanceTag('notices');
+
+ /**
+ * The [PerformanceTag] for time spent performing a _DartIndexOperation.
+ */
+ static PerformanceTag indexOperation = new PerformanceTag('indexOperation');
+
+ /**
+ * The [PerformanceTag] for time spent between calls to
+ * AnalysisServer.performOperation when the server is not idle.
+ */
+ static PerformanceTag intertask = new PerformanceTag('intertask');
+
+ /**
+ * The [PerformanceTag] for time spent between calls to
+ * AnalysisServer.performOperation when the server is idle.
+ */
+ static PerformanceTag idle = new PerformanceTag('idle');
+}
+
+
+/**
* A class used by [AnalysisServer] to record performance information
* such as request latency.
*/
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/get_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698