- [x] Add `ServiceProtocolnfo` class to dart:developer.
- [x] Add `Service` class to dart:developer.
- [x] Add `Service.getInfo` static method to dart:developer.
- [x] Add `Service.controlWebServer` static method to dart:developer.
API:
```dart
/// Information about the service protocol.
class ServiceProtocolInfo {
/// The major version of the protocol.
final int majorVersion;
/// The minor version of the protocol.
final int minorVersion;
/// The Uri to access the service. If the web server is not running, this
/// will be null.
final Uri serverUri;
}
/// Access information about the service protocol and control the web server.
class Service {
/// Get information about the service protocol.
static Future<ServiceProtocolInfo> getInfo();
/// Control the web server that the service protocol is accessed through.
static Future<ServiceProtocolInfo> controlWebServer({bool enable: false});
}
```
... and add a randomly generated authentication token path prefix that must be passed in to access the service protocol.
Old base url:
Observatory listening on http://127.0.0.1:54804/
New base url:
Observatory listening on http://127.0.0.1:54804/<token>/
For example:
Observatory listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/
Many tools will need to be updated.
Fixes#23320
BUG=
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2438613002 .
- [x] Add _getThreadCpuClock to dart:developer.
- [x] Report CPU usage for Dart synchronous timeline blocks.
- [x] GetEnvironmentValue for 'dart.vm.product' will return "true" or "false" depending on whether or not we are running in product mode.
- [x] Early out of Dart timeline calls if we are running in product mode.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1966833002 .
Fixes#25724
Fixes Florian Loitsch's emailed request (get rid of k prefix on constants).
- Rename ServiceExtensionResponse constants to not have a 'k' prefix.
- Provide more explanation on how to invoke service extensions (they require an 'isolateId' parameter).
- Require extension method names to begin with "ext." and recommend the template: "ext.package.command" to avoid conflicts with other packages.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1680593004 .
- Add dart:developer.postEvent for posting events to the service protocol.
- Add 'Extension' service protocol event stream.
- Unit test.
- Update service.md
- Bug fix for logging stream.
R=turnidge@google.com
Review URL: https://codereview.chromium.org/1537523002 .
A TimelineTask represents an asynchronous track of operations on the timeline.
The old API allowed multiple isolates to emit events simultaneously on the same task or to start / finish events in any order. This isn't supported by our UI and probably many other tools that consume trace-event.
With this change, operations within a TimelineTask must complete in the reverse order of their start calls (aka a stack). You can pass a TimelineTask from one isolate to another but you must first complete all open operations before passing it.
Example:
var task = new TimelineTask();
task.start('Some phase');
await someFuture;
task.finish();
Also: Add support for instant events.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1412183008 .
- Blocks are associated with threads and not isolates.
- Fix isolate filters when iterating over blocks and events.
- Always add the isolateNumber argument when serializing events.
- Add new (kSerializedJSON) EventType for events already serialized to JSON.
- Have events coming from Dart code use the standard event structure w/ type = kSerializedJSON.
- Remove now unused DartTimelineEvent and machinary.
- Dart and C++ events now use the same structures and system.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1411783004 .
- This CL only adds support for synchronous blocks of time. A follow up CL will add asynchronous blocks of time.
- Reports true thread id to tracing system. This is an improvement over Mojo's tracing helper.
- Dart events are included in individual isolate traces and global traces obtained via the embedders API.
- Dart events are included in the write to disk path (--timeline_dir).
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1377663002 .
- Make required arguments required.
- Validate required arguments in Dart before calling native.
- timestamp is now a DateTime.
- level has a default (ALL).
- sequence number is last + 1 if not provided.
R=lrn@google.com
Review URL: https://codereview.chromium.org//1266053003 .