A library to access the VM Service Protocol.
See the example for a simple use of the library's API.
The VM Service Protocol spec can be found at github.com/dart-lang/sdk/runtime/vm/service/service.md.
Features and bugs #
Please file feature requests and bugs at the issue tracker.
- Fixed issue where exception would be thrown when attempting to parse a List entry in a response which is not present. This occurs when connected to a service which does not yet support the latest service protocol supported by this package.
- Requests which have not yet completed when
VmService.disposeis invoked will now complete with an
RPCErrorexception rather than a
HeapSnapshotGraphclass which parses the binary events posted to the
HeapSnapshotstream after a
- Fixed issue where listening to
requestHeapSnapshotwould throw an exception.
- breaking: VM service objects which have fields now have constructors with
named parameters for each field. Required fields are annotated with
- Support service protocol version 3.27:
- Fixed issue where
closureContextwere only expected in
Instanceobjects rather than
- Fixed issue serializing list arguments for certain VM service methods.
- Issue #37872
- Support service protocol version 3.25:
- Support service protocol version 3.24:
- Updated description and homepage.
vm_service_libinto the Dart SDK.
- Renamed from
- Switched versioning system to follow semantic versioning standards instead of pinning versions to match the service protocol version.
Servicestream not being handled correctly.
- Fixed failing tests.
- breaking: Changed type of
Servicestream are now public.
Eventhas been updated to include the optional
- breaking: Fixed issue where an
nullcould be returned instead of null for non-
InstanceRefproperties and return values. As a result, some property and return types have been changed from Obj to their correct types.
- support service protocol version 3.21
- allow optional params in
- handle null isolate ids in
- add backwards compatibility for
- rev to 3.20.0; expose public methods added in 3.17 - 3.20 VM Service Protocol versions
- generate a list of available event streams
- rev to 3.17.0; expose the Logging event and the getMemoryUsage call
- fix handling of errors in registered service callbacks to return valid JSON-RPC errors and avoid the client getting "Service Disappeared" responses
- fix an assignment issue in
getVmWsUriFromObservatoryUri, a helper function to convert observatory URIs into the required WebSocket URI for connecting to the VM service.
- support service protocol version 3.15
- fix an issue decoding null
- Add support for the
_Servicestream in the
- Add support for automatically delegating service extension requests to the
client which registered them.
- This is only for services that are registered via the vm service protocol,
services registered through
dart:developershould be handled by the
VmServiceInterfaceimplementation (which should invoke the registered callback directly).
- This is only for services that are registered via the vm service protocol, services registered through
- Added a
ServiceExtensionRegistryclass, which tracks which clients have registered which service extensions.
- breaking: Renamed
VmServerConnectionshould be created per client connection to the server. These should typically all share the same underlying
VmServiceInterfaceinstance, as well as the same
callServiceExtensionmethod to the
VmServerwill delegate all requests whose methods start with
ext.to that implementation.
VmServerclasses, which can handle routing jsonrpc2 requests to a
VmServiceInterfaceinstance, and serializing the responses back.
toJsonmethods to all classes.
- fix code generation for the
- address an encoding issue with stdout / stderr text
- regenerate for
- bump to a major version numbering scheme
- work around an issue de-serializing Instance.closureContext
- fix an issue de-serializing some object types
- regenerate for
- handle nulls for
- fix a decoding issue for
- rev to version
3.9of the spec
- Rename the
- upgrades for Dart 2 dependencies
- ensure the library works with Dart 2
- regenerate the library based on the 3.8-dev spec
- now require a minimum of a 2.0.0-dev Dart SDK
- update to not use deprecated dart:convert constants
- workaround for an issue with the type of @Library refs for VM objects
- bug fix for deserializing
- improve access to the profiling APIs
- more strong mode runtime fixes
- expose some undocumented (and unsupported) service protocol methods
- fix strong mode issues at runtime (with JSLists and Lists)
- expose the ability to evaluate in the scope of another object
- expose the async causal frame info
- expose the
- expose the
frameIndexparam for the step call
- fix a strong mode issue in the generated Dart library
- expose the
- fix a parsing issue with ExtensionData
- expose the service protocol timeline API
- add the new
- include the name of the calling method in RPC errors
- fixed several strong mode analysis issues
- upgrade to service protocol version
- upgrade to service protocol version
- fixed a bug with the
- expose the new 'Extension' event information
- rev to 0.1.0; declare first stable API version
- improve the toString() message for RPCError
- bug fix for parsing MapAssociations
- bug fix to the service extension API
- expose a service extension API
- update to the latest spec to capture the
- allow listening to arbitrary event types
- use Strings for the enum types (to allow for unknown enum values)
- make the diagnostic logging synchronous
- remove a workaround for a VM bug (fixed in 1.13.0-dev.7.3)
- several strong mode fixes
exceptionPauseModeto the Isolate class
operator==methods to classes supporting object identity
- work around a VM bug with the
- added more dartdocs
- moved back to using Dart enums
- changed from optional positional params to optional named params
- enum redux
- update to use a custom enum class
- upgrade to the latest service protocol spec
- added the
- fixed an issue with enum parsing
- first publish
- upgraded the library to the 3.0 version of the service protocol
- upgraded the library to the 2.0 version of the service protocol
- copied basic Dart API generator from Atom Dart Plugin https://github.com/dart-atom/dartlang/tree/master/tool
- refactored Dart code to generate Java client as well as Dart client
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: vm_service: ^2.1.3
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Dec 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
Detected platforms: Flutter, web, other
No platform restriction found in primary library
lib/vm_service_io.dart. (-2.96 points)
lib/vm_service_io.dart reported 6 hints, including:
line 13 col 48: Unnecessary new keyword.
line 14 col 43: Unnecessary new keyword.
line 21 col 10: Unnecessary new keyword.
line 33 col 48: Unnecessary new keyword.
line 34 col 43: Unnecessary new keyword.
lib/src/helpers.dart. (-0.50 points)
lib/src/helpers.dart reported 1 hint:
line 15 col 18: Unnecessary new keyword.
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
vm_service.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.