@@ -55,7 +55,6 @@ import 'package:analyzer/src/dart/analysis/file_state.dart' as nd;
5555import 'package:analyzer/src/dart/analysis/status.dart' as nd;
5656import 'package:analyzer/src/generated/engine.dart' ;
5757import 'package:analyzer/src/generated/sdk.dart' ;
58- import 'package:analyzer/src/generated/utilities_general.dart' ;
5958import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element;
6059import 'package:analyzer_plugin/src/utilities/navigation/navigation.dart' ;
6160import 'package:analyzer_plugin/utilities/navigation/navigation_dart.dart' ;
@@ -234,34 +233,32 @@ class AnalysisServer extends AbstractAnalysisServer {
234233 void handleRequest (Request request) {
235234 performance.logRequestTiming (request.clientRequestTime);
236235 runZonedGuarded (() {
237- ServerPerformanceStatistics .serverRequests.makeCurrentWhile (() {
238- var count = handlers.length;
239- for (var i = 0 ; i < count; i++ ) {
240- try {
241- var response = handlers[i].handleRequest (request);
242- if (response == Response .DELAYED_RESPONSE ) {
243- return ;
244- }
245- if (response != null ) {
246- channel.sendResponse (response);
247- return ;
248- }
249- } on RequestFailure catch (exception) {
250- channel.sendResponse (exception.response);
236+ var count = handlers.length;
237+ for (var i = 0 ; i < count; i++ ) {
238+ try {
239+ var response = handlers[i].handleRequest (request);
240+ if (response == Response .DELAYED_RESPONSE ) {
251241 return ;
252- } catch (exception, stackTrace) {
253- var error = RequestError (
254- RequestErrorCode .SERVER_ERROR , exception.toString ());
255- if (stackTrace != null ) {
256- error.stackTrace = stackTrace.toString ();
257- }
258- var response = Response (request.id, error: error);
242+ }
243+ if (response != null ) {
259244 channel.sendResponse (response);
260245 return ;
261246 }
247+ } on RequestFailure catch (exception) {
248+ channel.sendResponse (exception.response);
249+ return ;
250+ } catch (exception, stackTrace) {
251+ var error =
252+ RequestError (RequestErrorCode .SERVER_ERROR , exception.toString ());
253+ if (stackTrace != null ) {
254+ error.stackTrace = stackTrace.toString ();
255+ }
256+ var response = Response (request.id, error: error);
257+ channel.sendResponse (response);
258+ return ;
262259 }
263- channel. sendResponse ( Response . unknownRequest (request));
264- } );
260+ }
261+ channel. sendResponse ( Response . unknownRequest (request) );
265262 }, (exception, stackTrace) {
266263 AnalysisEngine .instance.instrumentationService.logException (
267264 FatalException (
@@ -931,23 +928,3 @@ class ServerPerformance {
931928 }
932929 }
933930}
934-
935- /// Container with global [AnalysisServer] performance statistics.
936- class ServerPerformanceStatistics {
937- /// The [PerformanceTag] for `package:analysis_server` .
938- static final PerformanceTag server = PerformanceTag ('server' );
939-
940- /// The [PerformanceTag] for time spent between calls to
941- /// AnalysisServer.performOperation when the server is idle.
942- static final PerformanceTag idle = PerformanceTag ('idle' );
943-
944- /// The [PerformanceTag] for time spent in
945- /// PerformAnalysisOperation._sendNotices.
946- static final PerformanceTag notices = server.createChild ('notices' );
947-
948- /// The [PerformanceTag] for time spent in server communication channels.
949- static final PerformanceTag serverChannel = server.createChild ('channel' );
950-
951- /// The [PerformanceTag] for time spent in server request handlers.
952- static final PerformanceTag serverRequests = server.createChild ('requests' );
953- }
0 commit comments