stopTracingAndDownloadTimeline method

Future<Timeline> stopTracingAndDownloadTimeline ({Duration timeout })

Stops recording performance traces and downloads the timeline.

Implementation

Future<Timeline> stopTracingAndDownloadTimeline({ Duration timeout }) async {
  timeout ??= _shortTimeout(timeoutMultiplier);
  try {
    await _peer
        .sendRequest(_setVMTimelineFlagsMethodName, <String, String>{'recordedStreams': '[]'})
        .timeout(timeout);
    return Timeline.fromJson(await _peer.sendRequest(_getVMTimelineMethodName));
  } catch (error, stackTrace) {
    throw DriverError(
      'Failed to stop tracing due to remote error',
      error,
      stackTrace,
    );
  }
}