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

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

Issue 956103002: Add instrumentation (issue 22572) (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 | « pkg/analysis_server/test/context_manager_test.dart ('k') | 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 0cf572433fcbb8735a12ec4545c40d353e83e477..4a44db4c27cdfad6f3d4a8a3e6ef5dc6fc18671e 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -53,6 +53,7 @@ class InstrumentationService {
static final InstrumentationService NULL_SERVICE =
new InstrumentationService(null);
+ static const String TAG_ANALYSIS_TASK = 'Task';
static const String TAG_ERROR = 'Err';
static const String TAG_EXCEPTION = 'Ex';
static const String TAG_FILE_READ = 'Read';
@@ -62,6 +63,7 @@ class InstrumentationService {
static const String TAG_REQUEST = 'Req';
static const String TAG_RESPONSE = 'Res';
static const String TAG_VERSION = 'Ver';
+ static const String TAG_WATCH_EVENT = 'Watch';
/**
* The instrumentation server used to communicate with the server, or `null`
@@ -87,6 +89,17 @@ class InstrumentationService {
String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString();
/**
+ * Log that an analysis task is being performed in the given [context]. The
+ * task has the given [description].
+ */
+ void logAnalysisTask(String context, String description) {
+ if (_instrumentationServer != null) {
+ _instrumentationServer.log(
+ _join([TAG_ANALYSIS_TASK, context, description]));
+ }
+ }
+
+ /**
* Log the fact that an error, described by the given [message], has occurred.
*/
void logError(String message) {
@@ -201,6 +214,19 @@ class InstrumentationService {
}
/**
+ * Log that the file system watcher sent an event. The [folderPath] is the
+ * path to the folder containing the changed file, the [filePath] is the path
+ * of the file that changed, and the [changeType] indicates what kind of
+ * change occurred.
+ */
+ void logWatchEvent(String folderPath, String filePath, String changeType) {
+ if (_instrumentationServer != null) {
+ _instrumentationServer.log(
+ _join([TAG_WATCH_EVENT, folderPath, filePath, changeType]));
+ }
+ }
+
+ /**
* Signal that the client is done communicating with the instrumentation
* server. This method should be invoked exactly one time and no other methods
* should be invoked on this instance after this method has been invoked.
« no previous file with comments | « pkg/analysis_server/test/context_manager_test.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698