getPerfettoCpuSamples method

Future<PerfettoCpuSamples> getPerfettoCpuSamples(
  1. String isolateId, {
  2. int? timeOriginMicros,
  3. int? timeExtentMicros,
})

The getPerfettoCpuSamples RPC is used to retrieve samples collected by the CPU profiler, serialized in Perfetto's proto format. See PerfettoCpuSamples for a detailed description of the response.

The timeOriginMicros parameter is the beginning of the time range used to filter samples. It uses the same monotonic clock as dart:developer's Timeline.now and the VM embedding API's Dart_TimelineGetMicros. See VmService.getVMTimelineMicros for access to this clock through the service protocol.

The timeExtentMicros parameter specifies how large the time range used to filter samples should be.

For example, given timeOriginMicros and timeExtentMicros, only samples from the following time range will be returned: (timeOriginMicros, timeOriginMicros + timeExtentMicros).

If the profiler is disabled, an RPCError response will be returned.

If isolateId refers to an isolate which has exited, then the Collected Sentinel is returned.

This method will throw a SentinelException in the case a Sentinel is returned.

Implementation

Future<PerfettoCpuSamples> getPerfettoCpuSamples(String isolateId,
        {int? timeOriginMicros, int? timeExtentMicros}) =>
    _call('getPerfettoCpuSamples', {
      'isolateId': isolateId,
      if (timeOriginMicros != null) 'timeOriginMicros': timeOriginMicros,
      if (timeExtentMicros != null) 'timeExtentMicros': timeExtentMicros,
    });