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

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

Issue 844683003: Report incremental/full analysis performance via instrumentation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/instrumentation/instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index 65b47c13b4c824a94f2602e2422ced27dc3b5617..2cc18aeaa0d3a56e9ce133c1a412ee18d722332c 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -5,6 +5,14 @@
library instrumentation;
/**
+ * A container with analysis performance constants.
+ */
+class AnalysisPerformanceKind {
+ static const String FULL = 'analysis_full';
+ static const String INCREMENTAL = 'analysis_incremental';
+}
+
+/**
* The interface used by client code to communicate with an instrumentation
* server.
*/
@@ -49,6 +57,7 @@ class InstrumentationService {
static const String TAG_EXCEPTION = 'Ex';
static const String TAG_LOG_ENTRY = 'Log';
static const String TAG_NOTIFICATION = 'Noti';
+ static const String TAG_PERFORMANCE = 'Perf';
static const String TAG_REQUEST = 'Req';
static const String TAG_RESPONSE = 'Res';
static const String TAG_VERSION = 'Ver';
@@ -108,6 +117,18 @@ class InstrumentationService {
}
/**
+ * Log the given performance fact.
+ */
+ void logPerformance(String kind, Stopwatch sw, String message) {
+ sw.stop();
+ String elapsed = sw.elapsedMilliseconds.toString();
+ if (_instrumentationServer != null) {
+ _instrumentationServer.log(
+ _join([TAG_PERFORMANCE, kind, elapsed, message]));
+ }
+ }
+
+ /**
* Log that the given priority [exception] was thrown, with the given
* [stackTrace].
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698