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

Side by Side Diff: pkg/analysis_server/benchmark/integration/operation.dart

Issue 1310263003: Reformat code to minimize churn (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
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 library server.operation; 5 library server.operation;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:logging/logging.dart'; 10 import 'package:logging/logging.dart';
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Stopwatch stopwatch = new Stopwatch(); 80 Stopwatch stopwatch = new Stopwatch();
81 String originalId = json['id']; 81 String originalId = json['id'];
82 String method = json['method']; 82 String method = json['method'];
83 json['clientRequestTime'] = new DateTime.now().millisecondsSinceEpoch; 83 json['clientRequestTime'] = new DateTime.now().millisecondsSinceEpoch;
84 driver.logger.log(Level.FINE, 'Sending request: $method\n $json'); 84 driver.logger.log(Level.FINE, 'Sending request: $method\n $json');
85 stopwatch.start(); 85 stopwatch.start();
86 86
87 void recordResult(bool success, result) { 87 void recordResult(bool success, result) {
88 Duration elapsed = stopwatch.elapsed; 88 Duration elapsed = stopwatch.elapsed;
89 driver.results.record(method, elapsed, success: success); 89 driver.results.record(method, elapsed, success: success);
90 driver.logger.log( 90 driver.logger
91 Level.FINE, 'Response received: $method : $elapsed\n $result'); 91 .log(Level.FINE, 'Response received: $method : $elapsed\n $result');
92 } 92 }
93 93
94 driver.send(method, json['params']).then((Map<String, dynamic> result) { 94 driver.send(method, json['params']).then((Map<String, dynamic> result) {
95 recordResult(true, result); 95 recordResult(true, result);
96 processResult(originalId, result, stopwatch); 96 processResult(originalId, result, stopwatch);
97 }).catchError((exception) { 97 }).catchError((exception) {
98 recordResult(false, exception); 98 recordResult(false, exception);
99 converter.processErrorResponse(originalId, exception); 99 converter.processErrorResponse(originalId, exception);
100 }); 100 });
101 return null; 101 return null;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 subscription.cancel(); 226 subscription.cancel();
227 timer.cancel(); 227 timer.cancel();
228 String message = 'gave up waiting for analysis to complete'; 228 String message = 'gave up waiting for analysis to complete';
229 driver.logger.log(Level.WARNING, message); 229 driver.logger.log(Level.WARNING, message);
230 completer.completeError(message); 230 completer.completeError(message);
231 } 231 }
232 }); 232 });
233 return completer.future; 233 return completer.future;
234 } 234 }
235 } 235 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/benchmark/integration/main.dart ('k') | pkg/analysis_server/lib/src/analysis_logger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698