| Index: pkg/analyzer/lib/instrumentation/instrumentation.dart
|
| diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
|
| index 65b47c13b4c824a94f2602e2422ced27dc3b5617..2cc18aeaa0d3a56e9ce133c1a412ee18d722332c 100644
|
| --- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
|
| +++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
|
| @@ -5,6 +5,14 @@
|
| library instrumentation;
|
|
|
| /**
|
| + * A container with analysis performance constants.
|
| + */
|
| +class AnalysisPerformanceKind {
|
| + static const String FULL = 'analysis_full';
|
| + static const String INCREMENTAL = 'analysis_incremental';
|
| +}
|
| +
|
| +/**
|
| * The interface used by client code to communicate with an instrumentation
|
| * server.
|
| */
|
| @@ -49,6 +57,7 @@ class InstrumentationService {
|
| static const String TAG_EXCEPTION = 'Ex';
|
| static const String TAG_LOG_ENTRY = 'Log';
|
| static const String TAG_NOTIFICATION = 'Noti';
|
| + static const String TAG_PERFORMANCE = 'Perf';
|
| static const String TAG_REQUEST = 'Req';
|
| static const String TAG_RESPONSE = 'Res';
|
| static const String TAG_VERSION = 'Ver';
|
| @@ -108,6 +117,18 @@ class InstrumentationService {
|
| }
|
|
|
| /**
|
| + * Log the given performance fact.
|
| + */
|
| + void logPerformance(String kind, Stopwatch sw, String message) {
|
| + sw.stop();
|
| + String elapsed = sw.elapsedMilliseconds.toString();
|
| + if (_instrumentationServer != null) {
|
| + _instrumentationServer.log(
|
| + _join([TAG_PERFORMANCE, kind, elapsed, message]));
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Log that the given priority [exception] was thrown, with the given
|
| * [stackTrace].
|
| */
|
|
|