Skip to content

Commit

Permalink
Add plugin performance data to the server status pages
Browse files Browse the repository at this point in the history
Change-Id: Id890366462f94204d349ff625516354d09d50b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97943
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
bwilkerson authored and commit-bot@chromium.org committed Mar 26, 2019
1 parent 57321c1 commit 45c367d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pkg/analysis_server/lib/src/status/diagnostics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1104,19 +1104,19 @@ class PluginsPage extends DiagnosticPageWithNav {

@override
Future generateContent(Map<String, String> params) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;

h3('Analysis plugins');
List<PluginInfo> analysisPlugins = server.pluginManager.plugins;

if (analysisPlugins.isEmpty) {
blankslate('No known analysis plugins.');
} else {
analysisPlugins
.sort((first, second) => first.pluginId.compareTo(second.pluginId));
for (PluginInfo plugin in analysisPlugins) {
// TODO(brianwilkerson) Sort the plugins by name.
String id = plugin.pluginId;
PluginData data = plugin.data;
Map<String, List<int>> responseTimes =
PluginManager.pluginResponseTimes[plugin];

List<String> components = pathPackage.split(id);
int length = components.length;
Expand Down Expand Up @@ -1155,6 +1155,19 @@ class PluginsPage extends DiagnosticPageWithNav {
buf.writeln(root.root);
});
}
p('Performance:');
List<String> requestNames = responseTimes.keys.toList();
requestNames.sort();
for (String requestName in requestNames) {
List<int> data = responseTimes[requestName];
// TODO(brianwilkerson) Consider displaying these times as a graph,
// similar to the one in AbstractCompletionPage.generateContent.
StringBuffer buffer = new StringBuffer();
buffer.write(requestName);
buffer.write(' ');
buffer.write(data);
p(buffer.toString());
}
}
}
}
Expand Down

0 comments on commit 45c367d

Please sign in to comment.