startTracing method

Future<void> startTracing ({List<TimelineStream> streams: _defaultStreams, Duration timeout })

Starts recording performance traces.

Implementation

Future<void> startTracing({
  List<TimelineStream> streams = _defaultStreams,
  Duration timeout,
}) async {
  timeout ??= _shortTimeout(timeoutMultiplier);
  assert(streams != null && streams.isNotEmpty);
  try {
    await _peer.sendRequest(_setVMTimelineFlagsMethodName, <String, String>{
      'recordedStreams': _timelineStreamsToString(streams)
    }).timeout(timeout);
  } catch (error, stackTrace) {
    throw DriverError(
      'Failed to start tracing due to remote error',
      error,
      stackTrace,
    );
  }
}