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

Side by Side Diff: pkg/analysis_server/lib/src/get_handler.dart

Issue 1147043006: Tweak for the new task statistics formatting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis_server.src.get_handler; 5 library analysis_server.src.get_handler;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 taskClasses.forEach((Type taskClass) { 284 taskClasses.forEach((Type taskClass) {
285 int count = countMap[taskClass]; 285 int count = countMap[taskClass];
286 if (count == null) { 286 if (count == null) {
287 count = 0; 287 count = 0;
288 } 288 }
289 int totalTime = stopwatchMap[taskClass].elapsedMilliseconds; 289 int totalTime = stopwatchMap[taskClass].elapsedMilliseconds;
290 _writeRow(buffer, [ 290 _writeRow(buffer, [
291 taskClass.toString(), 291 taskClass.toString(),
292 count, 292 count,
293 totalTime, 293 totalTime,
294 count <= 0 ? '-' : totalTime / count 294 count <= 0 ? '-' : (totalTime / count).toStringAsFixed(3)
295 ], classes: [null, "right", "right", "right"]); 295 ], classes: [null, "right", "right", "right"]);
296 }); 296 });
297 buffer.write('</table>'); 297 buffer.write('</table>');
298 } else { 298 } else {
299 // 299 //
300 // Write old task model timing information. 300 // Write old task model timing information.
301 // 301 //
302 { 302 {
303 buffer.write('<p><b>Time spent in each phase of analysis</b></p>'); 303 buffer.write('<p><b>Time spent in each phase of analysis</b></p>');
304 buffer.write( 304 buffer.write(
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 */ 1616 */
1617 static String makeLink( 1617 static String makeLink(
1618 String path, Map<String, String> params, String innerHtml, 1618 String path, Map<String, String> params, String innerHtml,
1619 [bool hasError = false]) { 1619 [bool hasError = false]) {
1620 Uri uri = new Uri(path: path, queryParameters: params); 1620 Uri uri = new Uri(path: path, queryParameters: params);
1621 String href = HTML_ESCAPE.convert(uri.toString()); 1621 String href = HTML_ESCAPE.convert(uri.toString());
1622 String classAttribute = hasError ? ' class="error"' : ''; 1622 String classAttribute = hasError ? ' class="error"' : '';
1623 return '<a href="$href"$classAttribute>$innerHtml</a>'; 1623 return '<a href="$href"$classAttribute>$innerHtml</a>';
1624 } 1624 }
1625 } 1625 }
OLDNEW
« 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