| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:core'; | 7 import 'dart:core'; |
| 8 | 8 |
| 9 import 'package:analysis_server/protocol/protocol.dart'; | 9 import 'package:analysis_server/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 10 import 'package:analysis_server/protocol/protocol_generated.dart'; | 11 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 11 import 'package:analysis_server/src/analysis_server.dart'; | 12 import 'package:analysis_server/src/analysis_server.dart'; |
| 12 import 'package:analysis_server/src/constants.dart'; | |
| 13 import 'package:analyzer/src/context/cache.dart'; | 13 import 'package:analyzer/src/context/cache.dart'; |
| 14 import 'package:analyzer/src/context/context.dart'; | 14 import 'package:analyzer/src/context/context.dart'; |
| 15 import 'package:analyzer/src/dart/analysis/driver.dart' as nd; | 15 import 'package:analyzer/src/dart/analysis/driver.dart' as nd; |
| 16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
| 17 import 'package:analyzer/src/generated/source.dart'; | 17 import 'package:analyzer/src/generated/source.dart'; |
| 18 import 'package:analyzer/src/generated/utilities_collection.dart'; | 18 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| 19 import 'package:analyzer/src/task/driver.dart'; | 19 import 'package:analyzer/src/task/driver.dart'; |
| 20 import 'package:analyzer/task/model.dart'; | 20 import 'package:analyzer/task/model.dart'; |
| 21 | 21 |
| 22 int _workItemCount(AnalysisContextImpl context) { | 22 int _workItemCount(AnalysisContextImpl context) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } catch (error) { | 99 } catch (error) { |
| 100 server | 100 server |
| 101 .sendResponse(new Response.debugPortCouldNotBeOpened(request, error)); | 101 .sendResponse(new Response.debugPortCouldNotBeOpened(request, error)); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 @override | 105 @override |
| 106 Response handleRequest(Request request) { | 106 Response handleRequest(Request request) { |
| 107 try { | 107 try { |
| 108 String requestName = request.method; | 108 String requestName = request.method; |
| 109 if (requestName == DIAGNOSTIC_GET_DIAGNOSTICS) { | 109 if (requestName == DIAGNOSTIC_REQUEST_GET_DIAGNOSTICS) { |
| 110 return computeDiagnostics(request); | 110 return computeDiagnostics(request); |
| 111 } else if (requestName == DIAGNOSTIC_GET_SERVER_PORT) { | 111 } else if (requestName == DIAGNOSTIC_REQUEST_GET_SERVER_PORT) { |
| 112 handleGetServerPort(request); | 112 handleGetServerPort(request); |
| 113 return Response.DELAYED_RESPONSE; | 113 return Response.DELAYED_RESPONSE; |
| 114 } | 114 } |
| 115 } on RequestFailure catch (exception) { | 115 } on RequestFailure catch (exception) { |
| 116 return exception.response; | 116 return exception.response; |
| 117 } | 117 } |
| 118 return null; | 118 return null; |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 class MemoryCpuSample { | 122 class MemoryCpuSample { |
| 123 final DateTime time; | 123 final DateTime time; |
| 124 final double cpuPercentage; | 124 final double cpuPercentage; |
| 125 final int memoryKB; | 125 final int memoryKB; |
| 126 | 126 |
| 127 MemoryCpuSample(this.time, this.cpuPercentage, this.memoryKB); | 127 MemoryCpuSample(this.time, this.cpuPercentage, this.memoryKB); |
| 128 } | 128 } |
| OLD | NEW |