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

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

Issue 1490623002: Fix rolling averages in diagnostic status. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/domain_diagnostic.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/get_handler.dart
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index c51e4826e392e840de7bd0a59839958379ab2fbb..898dda8b150543b09adc7b44dc58ca5597983b8a 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -184,10 +184,22 @@ class GetHandler {
final Map<String, String> _overlayContents = <String, String>{};
/**
+ * Handler for diagnostics requests.
+ */
+ DiagnosticDomainHandler _diagnosticHandler;
+
+ /**
* Initialize a newly created handler for GET requests.
*/
GetHandler(this._server, this._printBuffer);
+ DiagnosticDomainHandler get diagnosticHandler {
+ if (_diagnosticHandler == null) {
+ _diagnosticHandler = new DiagnosticDomainHandler(_server.analysisServer);
+ }
+ return _diagnosticHandler;
+ }
+
/**
* Return the active [CompletionDomainHandler]
* or `null` if either analysis server is not running
@@ -1484,14 +1496,11 @@ class GetHandler {
* Write the status of the diagnostic domain to the given [buffer].
*/
void _writeDiagnosticStatus(StringBuffer buffer) {
- DiagnosticDomainHandler handler =
- new DiagnosticDomainHandler(_server.analysisServer);
-
var request = new DiagnosticGetDiagnosticsParams().toRequest('0');
var stopwatch = new Stopwatch();
stopwatch.start();
- var response = handler.handleRequest(request);
+ var response = diagnosticHandler.handleRequest(request);
stopwatch.stop();
int elapsedMs = stopwatch.elapsedMilliseconds;
« no previous file with comments | « pkg/analysis_server/lib/src/domain_diagnostic.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698