Pool Signal
A heuristic hint derived from DispatcherMetrics. Sealed so more signals can be added later. Signals are hints, not proof: they say where to look, not what is wrong.
Example:
when (val signal = metrics.signals().firstOrNull()) {
is PoolSignal.StarvationSuspected -> alert(signal.label)
is PoolSignal.LongRunningSegment -> alert(signal.label)
is PoolSignal.BacklogGrowing, is PoolSignal.PoolSaturated -> alert(signal.label)
null -> Unit
}Requires opting in to ExperimentalStructuredCoroutines.
See also
Inheritors
Types
pending never decreased across the last samples pool samples and rose from from to to. Produced by List<TraceEvent.PoolSample>.signals.
A single segment ran for longestRun, at or above the threshold.
Across the last samples pool samples the dispatcher ran at its parallelism limit while work was waiting. Produced by List<TraceEvent.PoolSample>.signals.
Work is waiting and waited long: pending is positive and the queue-delay p95 (queueDelayP95, a bucket upper bound) reached the threshold. pending can overcount, see DispatcherMetrics.pending.