| 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 get.handler; | 5 library get.handler; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException; | 10 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 response.write('<p>Running</p>'); | 61 response.write('<p>Running</p>'); |
| 62 response.write('<h1>Analysis Contexts</h1>'); | 62 response.write('<h1>Analysis Contexts</h1>'); |
| 63 response.write('<h2>Summary</h2>'); | 63 response.write('<h2>Summary</h2>'); |
| 64 response.write('<table>'); | 64 response.write('<table>'); |
| 65 _writeRow( | 65 _writeRow( |
| 66 response, | 66 response, |
| 67 ['Context', 'ERROR', 'FLUSHED', 'IN_PROCESS', 'INVALID', 'VALID'], | 67 ['Context', 'ERROR', 'FLUSHED', 'IN_PROCESS', 'INVALID', 'VALID'], |
| 68 true); | 68 true); |
| 69 // TODO(scheglov) replace with using folder based contexts | 69 // TODO(scheglov) replace with using folder based contexts |
| 70 _server.analysisServer.contextMap.forEach((String key, AnalysisContext con
text) { | 70 _server.analysisServer.contextMap.forEach((String key, AnalysisContext con
text) { |
| 71 AnalysisContextStatistics statistics = | 71 AnalysisContentStatistics statistics = |
| 72 (context as AnalysisContextImpl).statistics; | 72 (context as AnalysisContextImpl).statistics; |
| 73 int errorCount = 0; | 73 int errorCount = 0; |
| 74 int flushedCount = 0; | 74 int flushedCount = 0; |
| 75 int inProcessCount = 0; | 75 int inProcessCount = 0; |
| 76 int invalidCount = 0; | 76 int invalidCount = 0; |
| 77 int validCount = 0; | 77 int validCount = 0; |
| 78 statistics.cacheRows.forEach((AnalysisContextStatistics_CacheRow row) { | 78 statistics.cacheRows.forEach((AnalysisContentStatistics_CacheRow row) { |
| 79 errorCount += row.errorCount; | 79 errorCount += row.errorCount; |
| 80 flushedCount += row.flushedCount; | 80 flushedCount += row.flushedCount; |
| 81 inProcessCount += row.inProcessCount; | 81 inProcessCount += row.inProcessCount; |
| 82 invalidCount += row.invalidCount; | 82 invalidCount += row.invalidCount; |
| 83 validCount += row.validCount; | 83 validCount += row.validCount; |
| 84 }); | 84 }); |
| 85 _writeRow(response, [ | 85 _writeRow(response, [ |
| 86 '<a href="#context_$key">$key</a>', | 86 '<a href="#context_$key">$key</a>', |
| 87 errorCount, | 87 errorCount, |
| 88 flushedCount, | 88 flushedCount, |
| 89 inProcessCount, | 89 inProcessCount, |
| 90 invalidCount, | 90 invalidCount, |
| 91 validCount]); | 91 validCount]); |
| 92 }); | 92 }); |
| 93 response.write('</table>'); | 93 response.write('</table>'); |
| 94 _server.analysisServer.contextMap.forEach((String key, AnalysisContext con
text) { | 94 _server.analysisServer.contextMap.forEach((String key, AnalysisContext con
text) { |
| 95 response.write('<h2><a name="context_$key">Analysis Context: $key</a></h
2>'); | 95 response.write('<h2><a name="context_$key">Analysis Context: $key</a></h
2>'); |
| 96 AnalysisContextStatistics statistics = (context as AnalysisContextImpl).
statistics; | 96 AnalysisContentStatistics statistics = (context as AnalysisContextImpl).
statistics; |
| 97 response.write('<table>'); | 97 response.write('<table>'); |
| 98 _writeRow( | 98 _writeRow( |
| 99 response, | 99 response, |
| 100 ['Item', 'ERROR', 'FLUSHED', 'IN_PROCESS', 'INVALID', 'VALID'], | 100 ['Item', 'ERROR', 'FLUSHED', 'IN_PROCESS', 'INVALID', 'VALID'], |
| 101 true); | 101 true); |
| 102 statistics.cacheRows.forEach((AnalysisContextStatistics_CacheRow row) { | 102 statistics.cacheRows.forEach((AnalysisContentStatistics_CacheRow row) { |
| 103 _writeRow( | 103 _writeRow( |
| 104 response, | 104 response, |
| 105 [row.name, | 105 [row.name, |
| 106 row.errorCount, | 106 row.errorCount, |
| 107 row.flushedCount, | 107 row.flushedCount, |
| 108 row.inProcessCount, | 108 row.inProcessCount, |
| 109 row.invalidCount, | 109 row.invalidCount, |
| 110 row.validCount]); | 110 row.validCount]); |
| 111 }); | 111 }); |
| 112 response.write('</table>'); | 112 response.write('</table>'); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 response.write(value); | 152 response.write(value); |
| 153 response.write('</td>'); | 153 response.write('</td>'); |
| 154 }); | 154 }); |
| 155 if (header) { | 155 if (header) { |
| 156 response.write('</th>'); | 156 response.write('</th>'); |
| 157 } else { | 157 } else { |
| 158 response.write('</tr>'); | 158 response.write('</tr>'); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 } | 161 } |
| OLD | NEW |