Skip to main content

Module contention

Module contention 

Source
Expand description

Resource-contention rule: scheduling delay growing while tasks pile up.

Signature this detects: median per-task scheduled_ns (time spent woken but not yet polled) rises sharply between snapshots while busy work stays flat — tasks are queueing on a contended resource (pool, lock, single-threaded hot path) rather than doing slow work themselves. Pure function, no I/O, no LLM.

Constants§

DEFAULT_SCHED_RATIO
Median scheduled-time must grow by at least this ratio to fire.
MIN_TASKS
Minimum tasks with scheduled data required in each snapshot.

Functions§

detect_contention
detect_contention_with_threshold