| OLD | NEW |
| 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.status.get_handler; | 5 library analysis_server.src.status.get_handler; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'dart:math'; | 10 import 'dart:math'; |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 ]); | 753 ]); |
| 754 _writeRow(buffer, [ | 754 _writeRow(buffer, [ |
| 755 'Total', | 755 'Total', |
| 756 (explicitLineCount + implicitLineCount).toString(), | 756 (explicitLineCount + implicitLineCount).toString(), |
| 757 '${explicitLineInfoCount + implicitLineInfoCount} / ${explicitSource
Count + implicitSourceCount}' | 757 '${explicitLineInfoCount + implicitLineInfoCount} / ${explicitSource
Count + implicitSourceCount}' |
| 758 ], classes: [ | 758 ], classes: [ |
| 759 null, | 759 null, |
| 760 "right" | 760 "right" |
| 761 ]); | 761 ]); |
| 762 buffer.write('</table>'); | 762 buffer.write('</table>'); |
| 763 |
| 764 Map<ResultDescriptor, int> recomputedCounts = |
| 765 CacheEntry.recomputedCounts; |
| 766 List<ResultDescriptor> descriptors = recomputedCounts.keys.toList(); |
| 767 descriptors.sort(ResultDescriptor.SORT_BY_NAME); |
| 768 buffer.write('<p><b>Results computed after being flushed</b></p>'); |
| 769 buffer.write( |
| 770 '<table style="border-collapse: separate; border-spacing: 10px 5px
;">'); |
| 771 _writeRow(buffer, ['Result', 'Count'], header: true); |
| 772 for (ResultDescriptor descriptor in descriptors) { |
| 773 _writeRow(buffer, [descriptor.name, recomputedCounts[descriptor]], |
| 774 classes: [null, "right"]); |
| 775 } |
| 776 buffer.write('</table>'); |
| 763 }, (StringBuffer buffer) { | 777 }, (StringBuffer buffer) { |
| 764 // | 778 // |
| 765 // Write task model timing information. | 779 // Write task model timing information. |
| 766 // | 780 // |
| 767 buffer.write('<p><b>Task performance data</b></p>'); | 781 buffer.write('<p><b>Task performance data</b></p>'); |
| 768 buffer.write( | 782 buffer.write( |
| 769 '<table style="border-collapse: separate; border-spacing: 10px 5px
;">'); | 783 '<table style="border-collapse: separate; border-spacing: 10px 5px
;">'); |
| 770 _writeRow( | 784 _writeRow( |
| 771 buffer, | 785 buffer, |
| 772 [ | 786 [ |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 if (entries == null) { | 993 if (entries == null) { |
| 980 buffer.write('<p>Not being analyzed in this context.</p>'); | 994 buffer.write('<p>Not being analyzed in this context.</p>'); |
| 981 return; | 995 return; |
| 982 } | 996 } |
| 983 for (CacheEntry entry in entries) { | 997 for (CacheEntry entry in entries) { |
| 984 Map<String, String> linkParameters = <String, String>{ | 998 Map<String, String> linkParameters = <String, String>{ |
| 985 CONTEXT_QUERY_PARAM: folder.path, | 999 CONTEXT_QUERY_PARAM: folder.path, |
| 986 SOURCE_QUERY_PARAM: sourceUri | 1000 SOURCE_QUERY_PARAM: sourceUri |
| 987 }; | 1001 }; |
| 988 List<ResultDescriptor> results = _getExpectedResults(entry); | 1002 List<ResultDescriptor> results = _getExpectedResults(entry); |
| 989 results.sort((ResultDescriptor first, ResultDescriptor second) => | 1003 results.sort(ResultDescriptor.SORT_BY_NAME); |
| 990 first.toString().compareTo(second.toString())); | |
| 991 | 1004 |
| 992 buffer.write('<h3>'); | 1005 buffer.write('<h3>'); |
| 993 buffer.write(HTML_ESCAPE.convert(entry.target.toString())); | 1006 buffer.write(HTML_ESCAPE.convert(entry.target.toString())); |
| 994 buffer.write('</h3>'); | 1007 buffer.write('</h3>'); |
| 995 buffer.write('<p>time</p><blockquote><p>Value</p><blockquote>'); | 1008 buffer.write('<p>time</p><blockquote><p>Value</p><blockquote>'); |
| 996 buffer.write(entry.modificationTime); | 1009 buffer.write(entry.modificationTime); |
| 997 buffer.write('</blockquote></blockquote>'); | 1010 buffer.write('</blockquote></blockquote>'); |
| 998 for (ResultDescriptor result in results) { | 1011 for (ResultDescriptor result in results) { |
| 999 ResultData data = entry.getResultData(result); | 1012 ResultData data = entry.getResultData(result); |
| 1000 CacheState state = entry.getState(result); | 1013 CacheState state = entry.getState(result); |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 */ | 2482 */ |
| 2470 static String makeLink( | 2483 static String makeLink( |
| 2471 String path, Map<String, String> params, String innerHtml, | 2484 String path, Map<String, String> params, String innerHtml, |
| 2472 [bool hasError = false]) { | 2485 [bool hasError = false]) { |
| 2473 Uri uri = new Uri(path: path, queryParameters: params); | 2486 Uri uri = new Uri(path: path, queryParameters: params); |
| 2474 String href = HTML_ESCAPE.convert(uri.toString()); | 2487 String href = HTML_ESCAPE.convert(uri.toString()); |
| 2475 String classAttribute = hasError ? ' class="error"' : ''; | 2488 String classAttribute = hasError ? ' class="error"' : ''; |
| 2476 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 2489 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
| 2477 } | 2490 } |
| 2478 } | 2491 } |
| OLD | NEW |