Pool Sample
A periodic snapshot of one dispatcher pool, produced by PoolSampler (never by TracingDispatcher) at TraceLevel.Pool. A series of samples shows how the pool behaves over time, which cumulative DispatcherMetrics cannot.
queued, started and finished are cumulative counters from DispatcherMetrics. pending is max(0, queued - started) and can overcount when dangling Queued events exist (a dispatcher that swallows blocks, see TracingDispatcher). running is started - finished and peakRunning the highest concurrency observed so far. parallelism is the configured or inferred maximum concurrency of the pool when known, else null (see TracedDispatcherProvider.parallelism).
timestampNanos is measured from the creation of the PoolSampler that produced the sample, not from the creation of any TracingDispatcher: only differences between samples of the same sampler are meaningful.
Example:
val sink = TraceSink { event ->
if (event is TraceEvent.PoolSample) println("${event.dispatcher}: pending=${event.pending}")
}Constructors
Properties
Label of the dispatcher that produced the event, such as "io" or "default".
Lowest TraceLevel at which this event is produced.
configured or inferred concurrency limit, or null when unknown.
highest concurrency observed so far.
Monotonic timestamp in nanoseconds. Only differences between events are meaningful.