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

Unified Diff: pkg/analysis_server/lib/src/status/get_handler.dart

Issue 1406983007: Compute and display tasks input timings. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | pkg/analyzer/lib/src/task/driver.dart » ('j') | pkg/analyzer/lib/src/task/driver.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/get_handler.dart
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index d4b406baaa63bdffb6c1cc289c01606f6c87a269..d0ff880c288f0a1023a267452bfb42857df0b545 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -35,6 +35,7 @@ import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_collection.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/src/task/driver.dart';
import 'package:analyzer/src/task/html.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:analyzer/task/dart.dart';
@@ -556,6 +557,48 @@ class GetHandler {
classes: [null, "right", "right", "right"]);
buffer.write('</table>');
});
+ //
+ // Write task model inputs timing information.
+ //
+ {
+ buffer.write('<p><b>Task inputs performace data</b></p>');
+ buffer.write(
+ '<table style="border-collapse: separate; border-spacing: 10px 5px;">');
+ _writeRow(
+ buffer,
+ [
+ 'Task Name',
+ 'Count',
+ 'Total Time (in ms)',
+ 'Average Time (in ms)'
+ ],
+ header: true);
+
+ Map<String, int> countMap = WorkItem.countMap;
+ Map<String, Stopwatch> stopwatchMap = WorkItem.stopwatchMap;
+ List<String> taskClasses = stopwatchMap.keys.toList();
+ taskClasses.sort((String first, String second) =>
+ first.toString().compareTo(second.toString()));
+ taskClasses.forEach((String taskClass) {
+ int count = countMap[taskClass];
+ if (count == null) {
+ count = 0;
+ }
+ int taskTime = stopwatchMap[taskClass].elapsedMilliseconds;
+ _writeRow(buffer, [
+ taskClass.toString(),
+ count,
+ taskTime,
+ count <= 0 ? '-' : (taskTime / count).toStringAsFixed(3)
+ ], classes: [
+ null,
+ "right",
+ "right",
+ "right"
+ ]);
+ });
+ buffer.write('</table>');
+ }
});
});
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/driver.dart » ('j') | pkg/analyzer/lib/src/task/driver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698