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

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

Issue 847963003: Add indication of instrumentation active/inactive to analysis server status. (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 | « pkg/analysis_server/lib/src/get_handler.dart ('k') | no next file » | 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 c3a9920bd5a1fa89c2b53cc62a440de245be64a7..2d57d621a838950c701449d75c821bf70cec37d3 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -76,6 +76,12 @@ class InstrumentationService {
InstrumentationService(this._instrumentationServer);
/**
+ * Return true if this [InstrumentationService] was initialized with a
Brian Wilkerson 2015/01/13 22:33:29 nit: "true" --> "`true`", "null" --> "`null`"
Paul Berry 2015/01/14 18:23:03 Done.
+ * non-null server (and hence instrumentation is active).
+ */
+ bool get isActive => _instrumentationServer != null;
+
+ /**
* The current time, expressed as a decimal encoded number of milliseconds.
*/
String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString();
@@ -106,7 +112,8 @@ class InstrumentationService {
void logFileRead(String path, int modificationTime, String content) {
if (_instrumentationServer != null) {
Brian Wilkerson 2015/01/13 22:33:29 We should replace existing tests of this form with
Paul Berry 2015/01/14 18:23:03 Agreed. I'll do a follow-up CL.
String timeStamp = _toString(modificationTime);
- _instrumentationServer.log(_join([TAG_FILE_READ, path, timeStamp, content]));
+ _instrumentationServer.log(
+ _join([TAG_FILE_READ, path, timeStamp, content]));
}
}
@@ -117,7 +124,8 @@ class InstrumentationService {
*/
void logLogEntry(String level, DateTime time, String message) {
if (_instrumentationServer != null) {
- String timeStamp = time == null ? 'null' : time.millisecondsSinceEpoch.toString();
+ String timeStamp =
+ time == null ? 'null' : time.millisecondsSinceEpoch.toString();
_instrumentationServer.log(
_join([TAG_LOG_ENTRY, level, timeStamp, message]));
}
« no previous file with comments | « pkg/analysis_server/lib/src/get_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698