getAllocationTraces method

Future<CpuSamples> getAllocationTraces(
  1. String isolateId,
  2. {int? timeOriginMicros,
  3. int? timeExtentMicros,
  4. String? classId}
)

The getAllocationTraces RPC allows for the retrieval of allocation traces for objects of a specific set of types (see VmService.setTraceClassAllocation). Only samples collected in the time range [timeOriginMicros, timeOriginMicros + timeExtentMicros] will be reported.

If classId is provided, only traces for allocations with the matching classId will be reported.

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

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

See CpuSamples.

Implementation

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