-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm/service] Introduce IsolateGroup entity to vm service api.
This is to enable vm clients to ask how much memory is consumed by isolate group. Issue #36097 Change-Id: I4f1c499bf02c20b80e9802d8ad60e7ea65cfb375 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119724 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
- Loading branch information
Showing
29 changed files
with
906 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:test/test.dart'; | ||
import 'package:vm_service/vm_service.dart'; | ||
|
||
import 'common/test_helper.dart'; | ||
|
||
var tests = <VMTest>[ | ||
(VmService service) async { | ||
final vm = await service.getVM(); | ||
final result = | ||
await service.getIsolateGroupMemoryUsage(vm.isolateGroups.first.id); | ||
expect(result.heapUsage, isPositive); | ||
expect(result.heapCapacity, isPositive); | ||
expect(result.externalUsage, isNonNegative); | ||
}, | ||
(VmService service) async { | ||
bool caughtException; | ||
try { | ||
await service.getMemoryUsage('badid'); | ||
fail('Unreachable'); | ||
} on RPCError catch (e) { | ||
caughtException = true; | ||
expect( | ||
e.details, | ||
contains( | ||
"getMemoryUsage: invalid 'isolateGroupId' parameter: badid")); | ||
} | ||
expect(caughtException, isTrue); | ||
}, | ||
]; | ||
|
||
main(args) async => runVMTests(args, tests); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.