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

Unified Diff: pkg/analysis_server/lib/src/services/completion/completion_manager.dart

Issue 813563007: improve completion performance status page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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/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;
}
« 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