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

Side by Side Diff: pkg/analysis_server/test/src/utilities/profiling_test.dart

Issue 2959643002: Fix an issue calculating analysis server cpu usage. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « pkg/analysis_server/lib/src/utilities/profiling.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:io'; 5 import 'dart:io';
6 6
7 import 'package:analysis_server/src/utilities/profiling.dart'; 7 import 'package:analysis_server/src/utilities/profiling.dart';
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 main() { 10 main() {
11 group('ProcessProfiler', () { 11 group('ProcessProfiler', () {
12 // Skip on windows. 12 // Skip on windows.
13 if (Platform.isWindows) { 13 if (Platform.isWindows) {
14 return; 14 return;
15 } 15 }
16 16
17 test('getProfilerForPlatform', () async { 17 test('getProfilerForPlatform', () async {
18 expect(ProcessProfiler.getProfilerForPlatform(), isNotNull); 18 expect(ProcessProfiler.getProfilerForPlatform(), isNotNull);
19 }); 19 });
20 20
21 // TODO: https://github.com/dart-lang/sdk/issues/29815 21 test('getProcessUsage', () async {
22 // test('getProcessUsage', () async { 22 ProcessProfiler profiler = ProcessProfiler.getProfilerForPlatform();
23 // ProcessProfiler profiler = ProcessProfiler.getProfilerForPlatform(); 23 UsageInfo info = await profiler.getProcessUsage(pid);
24 // UsageInfo info = await profiler.getProcessUsage(pid); 24
25 // 25 expect(info, isNotNull);
26 // expect(info, isNotNull); 26 expect(info.cpuPercentage, greaterThanOrEqualTo(0.0));
27 // expect(info.cpuPercentage, greaterThanOrEqualTo(0.0)); 27 expect(info.memoryKB, greaterThanOrEqualTo(0));
28 // expect(info.memoryKB, greaterThanOrEqualTo(0)); 28 });
29 // });
30 }); 29 });
31 } 30 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/utilities/profiling.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698