Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Observing the Dart VM internals


If you have been watching the output window keenly as you have launched Dart projects, you will have noticed references to the Observatory. This tool (which is part of the Dart SDK) allows developers to look inside a running Dart virtual machine, and profile the ongoing activities. This is useful to find out exactly what an application is doing and where bottlenecks exist.

The Observatory supports command line applications and web applications (Dart versions and not the compiled to JavaScript output) running in Dartium. To enable it, simply pass one of the many Observatory command line parameters—see the SDK documents (https://www.dartlang.org/tools/dart-vm/) for a full listing:

dart --enable-vm-service bin/main.dart

Launch the main.dart program with the Observatory attached, and browse to the address localhost:8181 (note that this port number can change though it can be specified in the launch command parameter --enable-vm-service=<port>/<IP address...