| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library instrumentation; | 5 library instrumentation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/task/model.dart'; | 10 import 'package:analyzer/task/model.dart'; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * The current time, expressed as a decimal encoded number of milliseconds. | 99 * The current time, expressed as a decimal encoded number of milliseconds. |
| 100 */ | 100 */ |
| 101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); | 101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * Log that the given analysis [task] is being performed in the given | 104 * Log that the given analysis [task] is being performed in the given |
| 105 * [context]. | 105 * [context]. |
| 106 */ | 106 */ |
| 107 void logAnalysisTask(String context, dynamic task) { | 107 void logAnalysisTask(String context, AnalysisTask task) { |
| 108 // TODO(brianwilkerson) When the old task model is removed, change the | |
| 109 // parameter type to AnalysisTask. | |
| 110 if (_instrumentationServer != null) { | 108 if (_instrumentationServer != null) { |
| 111 String description = | 109 String description = |
| 112 (task is AnalysisTask) ? task.description : task.toString(); | 110 (task is AnalysisTask) ? task.description : task.toString(); |
| 113 _instrumentationServer | 111 _instrumentationServer |
| 114 .log(_join([TAG_ANALYSIS_TASK, context, description])); | 112 .log(_join([TAG_ANALYSIS_TASK, context, description])); |
| 115 } | 113 } |
| 116 } | 114 } |
| 117 | 115 |
| 118 /** | 116 /** |
| 119 * Log the fact that an error, described by the given [message], has occurred. | 117 * Log the fact that an error, described by the given [message], has occurred. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 371 } |
| 374 } | 372 } |
| 375 | 373 |
| 376 @override | 374 @override |
| 377 Future shutdown() async { | 375 Future shutdown() async { |
| 378 for (InstrumentationServer server in _servers) { | 376 for (InstrumentationServer server in _servers) { |
| 379 await server.shutdown(); | 377 await server.shutdown(); |
| 380 } | 378 } |
| 381 } | 379 } |
| 382 } | 380 } |
| OLD | NEW |