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

Unified Diff: pkg/analyzer/lib/task/model.dart

Issue 914783002: Count task frequency in new task model (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 | « no previous file | 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 a00b215214fcb7c687a2fa9e0b366b434844514d..3fd8ddb8fb733eda8c13b8d11bb56bb1bede0a79 100644
--- a/pkg/analyzer/lib/task/model.dart
+++ b/pkg/analyzer/lib/task/model.dart
@@ -49,6 +49,12 @@ abstract class AnalysisTarget {
*/
abstract class AnalysisTask {
/**
+ * A table mapping the types of analysis tasks to the number of times each
+ * kind of task has been performed.
+ */
+ static final Map<Type, int> countMap = new HashMap<Type, int>();
+
+ /**
* A table mapping the types of analysis tasks to stopwatches used to compute
* how much time was spent executing each kind of task.
*/
@@ -164,6 +170,8 @@ abstract class AnalysisTask {
*/
void _safelyPerform() {
try {
+ int count = countMap[runtimeType];
+ countMap[runtimeType] = count == null ? 1 : count + 1;
Stopwatch stopwatch = stopwatchMap[runtimeType];
if (stopwatch == null) {
stopwatch = new Stopwatch();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698