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

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

Issue 2918533002: Updates to the diagnostics page. (Closed)
Patch Set: use integer division Created 3 years, 7 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 | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/status/pages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/diagnostics.dart
diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart
index af4687498a7ccde4376b03ca5eafbe3e35f25952..bd97f6f595a149b4dfb645fd5cfab8212a93a977 100644
--- a/pkg/analysis_server/lib/src/status/diagnostics.dart
+++ b/pkg/analysis_server/lib/src/status/diagnostics.dart
@@ -108,6 +108,11 @@ td.pre {
white-space: nowrap;
}
+.scroll-table {
+ max-height: 190px;
+ overflow-x: auto;
+}
+
.footer {
padding-top: 3rem;
padding-bottom: 3rem;
@@ -428,7 +433,7 @@ class ProfilePage extends DiagnosticPageWithNav {
// prepare sorted tags
List<PerformanceTag> tags = PerformanceTag.all.toList();
tags.remove(ServerPerformanceStatistics.idle);
- tags.removeWhere((tag) => tag.label == 'unknown');
+ tags.remove(PerformanceTag.UNKNOWN);
tags.sort((a, b) => b.elapsedMs - a.elapsedMs);
// draw a pie chart
@@ -466,8 +471,10 @@ class ProfilePage extends DiagnosticPageWithNav {
buf.write('<th>$d</th>');
}
} else {
- for (String d in data) {
- buf.write('<td>$d</td>');
+ buf.write('<td>${data[0]}</td>');
+
+ for (String d in data.sublist(1)) {
+ buf.write('<td class="right">$d</td>');
}
}
buf.writeln('</tr>');
@@ -607,20 +614,20 @@ class ContextsPage extends DiagnosticPageWithNav {
h3('Context files');
h4('Priority files ${lenCounter(priorityFiles)}', raw: true);
- inputList(priorityFiles, (file) => buf.write(file));
+ ul(priorityFiles, (file) => buf.write(file), classes: 'scroll-table');
h4('Added files ${lenCounter(addedFiles)}', raw: true);
- inputList(addedFiles, (file) => buf.write(file));
+ ul(addedFiles, (file) => buf.write(file), classes: 'scroll-table');
h4('ImplicitFiles files ${lenCounter(implicitFiles)}', raw: true);
- inputList(implicitFiles, (file) => buf.write(file));
+ ul(implicitFiles, (file) => buf.write(file), classes: 'scroll-table');
SourceFactory sourceFactory = driver.sourceFactory;
if (sourceFactory is SourceFactoryImpl) {
h3('Resolvers');
for (UriResolver resolver in sourceFactory.resolvers) {
h4(resolver.runtimeType.toString());
- buf.write('<p>');
+ buf.write('<p class="scroll-table">');
if (resolver is DartUriResolver) {
DartSdk sdk = resolver.dartSdk;
buf.write(' (sdk = ');
@@ -890,8 +897,8 @@ class CommunicationsPage extends DiagnosticPageWithNav {
h3('Current');
int requestCount = perf.requestCount;
- double averageLatency =
- requestCount > 0 ? (perf.requestLatency / requestCount) : 0.0;
+ int averageLatency =
+ requestCount > 0 ? (perf.requestLatency ~/ requestCount) : 0;
int maximumLatency = perf.maxLatency;
double slowRequestPercent =
requestCount > 0 ? (perf.slowRequestCount / requestCount) : 0.0;
@@ -906,6 +913,13 @@ class CommunicationsPage extends DiagnosticPageWithNav {
writeRow([printPercentage(slowRequestPercent), '> 150 ms latency'],
classes: ["right", null]);
buf.write('</table>');
+
+ String time = server.uptime.toString();
+ if (time.contains('.')) {
+ time = time.substring(0, time.indexOf('.'));
+ }
+ buf.writeln(writeOption('Uptime', time));
+
buf.write('</div>');
}
@@ -914,8 +928,8 @@ class CommunicationsPage extends DiagnosticPageWithNav {
perf = server.performanceDuringStartup;
int requestCount = perf.requestCount;
- double averageLatency =
- requestCount > 0 ? (perf.requestLatency / requestCount) : 0.0;
+ int averageLatency =
+ requestCount > 0 ? (perf.requestLatency ~/ requestCount) : 0;
int maximumLatency = perf.maxLatency;
double slowRequestPercent =
requestCount > 0 ? (perf.slowRequestCount / requestCount) : 0.0;
@@ -934,7 +948,8 @@ class CommunicationsPage extends DiagnosticPageWithNav {
if (server.performanceAfterStartup != null) {
int startupTime =
server.performanceAfterStartup.startTime - perf.startTime;
- p('(initial analysis time: ${printMilliseconds(startupTime)})');
+ buf.writeln(
+ writeOption('Initial analysis time', printMilliseconds(startupTime)));
}
buf.write('</div>');
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/status/pages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698