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

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

Issue 825683005: Instrument file reads (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..49e31f6b106def367887e993fbd09533126c9e06 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -47,6 +47,7 @@ class InstrumentationService {
static const String TAG_ERROR = 'Err';
static const String TAG_EXCEPTION = 'Ex';
+ static const String TAG_FILE_READ = 'Read';
static const String TAG_LOG_ENTRY = 'Log';
static const String TAG_NOTIFICATION = 'Noti';
static const String TAG_REQUEST = 'Req';
@@ -90,11 +91,24 @@ class InstrumentationService {
}
/**
- * Log a log entry that was written to the analysis engine's log.
+ * Log that the contents of the file with the given [path] were read. The file
+ * had the given [content] and [modificationTime].
+ */
+ void logFileRead(String path, int modificationTime, String content) {
+ if (_instrumentationServer != null) {
+ String timeStamp = _toString(modificationTime);
+ _instrumentationServer.log(_join([TAG_FILE_READ, path, timeStamp, content]));
+ }
+ }
+
+ /**
+ * Log that a log entry that was written to the analysis engine's log. The log
+ * entry has the given [level] and [message], and was created at the given
+ * [time].
*/
void logLogEntry(String level, DateTime time, String message) {
if (_instrumentationServer != null) {
- String timeStamp = _toString(time);
+ String timeStamp = time == null ? 'null' : time.millisecondsSinceEpoch.toString();
_instrumentationServer.log(
_join([TAG_LOG_ENTRY, level, timeStamp, message]));
}
« 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