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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 956103002: Add instrumentation (issue 22572) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 26b1136053cec44a328263fa99361455e2fc5322..592fddab9dbc9cb7bef78a7eb3a3ede6d085adfb 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -9,6 +9,7 @@ import 'dart:collection';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/source/package_map_provider.dart';
import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -86,7 +87,13 @@ abstract class ContextManager {
*/
final PackageMapProvider _packageMapProvider;
- ContextManager(this.resourceProvider, this._packageMapProvider) {
+ /**
+ * The instrumentation service used to report instrumentation data.
+ */
+ final InstrumentationService _instrumentationService;
+
+ ContextManager(this.resourceProvider, this._packageMapProvider,
+ this._instrumentationService) {
pathContext = resourceProvider.pathContext;
}
@@ -360,6 +367,7 @@ abstract class ContextManager {
});
UriResolver packageUriResolver = _computePackageUriResolver(folder, info);
info.context = addContext(folder, packageUriResolver);
+ info.context.name = folder.path;
return info;
}
@@ -460,6 +468,10 @@ abstract class ContextManager {
}
void _handleWatchEvent(Folder folder, _ContextInfo info, WatchEvent event) {
+ _instrumentationService.logWatchEvent(
+ folder.path,
+ event.path,
+ event.type.toString());
String path = event.path;
// maybe excluded globally
if (_isExcluded(path)) {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698