| Index: pkg/analysis_server/lib/src/services/completion/completion_manager.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
|
| index a8d16db64cbc37de62bd1182d50e6ff8a9505d78..88d1411919cbaa6a48ecdbef5ba4ab45eafc820c 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
|
| @@ -115,6 +115,7 @@ abstract class CompletionManager {
|
| * Overall performance of a code completion operation.
|
| */
|
| class CompletionPerformance {
|
| + final DateTime start = new DateTime.now();
|
| final Map<String, Duration> _startTimes = new Map<String, Duration>();
|
| final Stopwatch _stopwatch = new Stopwatch();
|
| final List<OperationPerformance> operations = <OperationPerformance>[];
|
| @@ -124,6 +125,7 @@ class CompletionPerformance {
|
| String contents;
|
| int notificationCount = -1;
|
| int suggestionCount = -1;
|
| + Duration _firstNotification;
|
|
|
| CompletionPerformance() {
|
| _stopwatch.start();
|
| @@ -132,6 +134,9 @@ class CompletionPerformance {
|
| int get elapsedInMilliseconds =>
|
| operations.length > 0 ? operations.last.elapsed.inMilliseconds : 0;
|
|
|
| + int get firstNotificationInMilliseconds =>
|
| + _firstNotification != null ? _firstNotification.inMilliseconds : 0;
|
| +
|
| String get snippet {
|
| if (contents == null || offset < 0 || contents.length < offset) {
|
| return '???';
|
| @@ -181,6 +186,11 @@ class CompletionPerformance {
|
| return result;
|
| }
|
|
|
| + void logFirstNotificationComplete(String tag) {
|
| + _firstNotification = _stopwatch.elapsed;
|
| + _logDuration(tag, _firstNotification);
|
| + }
|
| +
|
| void logStartTime(String tag) {
|
| _startTimes[tag] = _stopwatch.elapsed;
|
| }
|
|
|