getCpuSamples method

Future<CpuSamples> getCpuSamples(
  1. String isolateId,
  2. int timeOriginMicros,
  3. int timeExtentMicros
)

The getCpuSamples RPC is used to retrieve samples collected by the CPU profiler. See CpuSamples 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<CpuSamples> getCpuSamples(
        String isolateId, int timeOriginMicros, int timeExtentMicros) =>
    _call('getCpuSamples', {
      'isolateId': isolateId,
      'timeOriginMicros': timeOriginMicros,
      'timeExtentMicros': timeExtentMicros
    });