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

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

Issue 1152923002: Improve logging performance (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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/task/model.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 ccb21491e2e00c674f6f671ff0b03b16a82683a4..ee3c74729ea2474cef10fafe2f742dc9eea56fb0 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -6,6 +6,8 @@ library instrumentation;
import 'dart:convert';
+import 'package:analyzer/task/model.dart';
+
/**
* A container with analysis performance constants.
*/
@@ -98,11 +100,15 @@ 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].
+ * Log that the given analysis [task] is being performed in the given
+ * [context].
*/
- void logAnalysisTask(String context, String description) {
+ void logAnalysisTask(String context, dynamic task) {
+ // TODO(brianwilkerson) When the old task model is removed, change the
+ // parameter type to AnalysisTask.
if (_instrumentationServer != null) {
+ String description =
+ (task is AnalysisTask) ? task.description : task.toString();
_instrumentationServer
.log(_join([TAG_ANALYSIS_TASK, context, description]));
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698