deferredThreadStats function

({int frames, int recordUs, int replayUs, int streamPeakBytes}) deferredThreadStats(
  1. Factory factory
)

Producer and consumer busy time since the last call, plus the largest stream any one of those frames recorded. Zeros when no deferred session is active. It is a high water mark sampled at snapshot rather than a live read, because a session's stream drains at the frame boundary.

Implementation

({int recordUs, int replayUs, int frames, int streamPeakBytes})
    deferredThreadStats(Factory factory) {
  if (factory is! DeferredSessionFactory || factory.sessionAddress == 0) {
    return (recordUs: 0, replayUs: 0, frames: 0, streamPeakBytes: 0);
  }
  return factory.sampleThreadStats();
}