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

Unified Diff: pkg/analyzer/lib/task/model.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
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/task/model.dart
diff --git a/pkg/analyzer/lib/task/model.dart b/pkg/analyzer/lib/task/model.dart
index 3fd8ddb8fb733eda8c13b8d11bb56bb1bede0a79..79c922091cba7666a967a87190e6808050ff4174 100644
--- a/pkg/analyzer/lib/task/model.dart
+++ b/pkg/analyzer/lib/task/model.dart
@@ -170,6 +170,19 @@ abstract class AnalysisTask {
*/
void _safelyPerform() {
try {
+ //
+ // Report that this task is being performed.
+ //
+ String contextName = context.name;
+ if (contextName == null) {
+ contextName = 'unnamed';
+ }
+ AnalysisEngine.instance.instrumentationService.logAnalysisTask(
+ contextName,
+ description);
+ //
+ // Gather statistics on the performance of the task.
+ //
int count = countMap[runtimeType];
countMap[runtimeType] = count == null ? 1 : count + 1;
Stopwatch stopwatch = stopwatchMap[runtimeType];
@@ -178,6 +191,9 @@ abstract class AnalysisTask {
stopwatchMap[runtimeType] = stopwatch;
}
stopwatch.start();
+ //
+ // Actually perform the task.
+ //
try {
internalPerform();
} finally {
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698