OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:math'; | 8 import 'dart:math'; |
9 | 9 |
10 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 10 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
11 import 'package:unittest/unittest.dart'; | 11 import 'package:test/test.dart'; |
12 | 12 |
13 import '../../test/integration/integration_tests.dart'; | 13 import '../../test/integration/integration_tests.dart'; |
14 | 14 |
15 void printMemoryResults(String id, String description, List<int> sizes) { | 15 void printMemoryResults(String id, String description, List<int> sizes) { |
16 int minMemory = sizes.fold(sizes.first, min); | 16 int minMemory = sizes.fold(sizes.first, min); |
17 int maxMemory = sizes.fold(sizes.first, max); | 17 int maxMemory = sizes.fold(sizes.first, max); |
18 String now = new DateTime.now().toUtc().toIso8601String(); | 18 String now = new DateTime.now().toUtc().toIso8601String(); |
19 print('$now ========== $id'); | 19 print('$now ========== $id'); |
20 print('memory: $sizes'); | 20 print('memory: $sizes'); |
21 print('min_memory: $minMemory'); | 21 print('min_memory: $minMemory'); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Set roots and analyze. | 121 // Set roots and analyze. |
122 await test.sendAnalysisSetAnalysisRoots(roots, []); | 122 await test.sendAnalysisSetAnalysisRoots(roots, []); |
123 await test.analysisFinished; | 123 await test.analysisFinished; |
124 sizes.add(test.getMemoryUsage()); | 124 sizes.add(test.getMemoryUsage()); |
125 // Stop the server. | 125 // Stop the server. |
126 await test.shutdown(); | 126 await test.shutdown(); |
127 } | 127 } |
128 return sizes; | 128 return sizes; |
129 } | 129 } |
130 } | 130 } |
OLD | NEW |