Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor polls CPU and memory usage and provides an Admit gate that blocks dispatch when resources are over threshold.
func New ¶
New creates a Monitor and starts polling in the background. Call Stop (via context cancellation) to halt the poller.
func (*Monitor) Admit ¶
Admit blocks until resources are below threshold or ctx is cancelled. It waits for the first poll to complete before evaluating. Admit wakes immediately when the poller records a new sample, so it responds within one poll interval rather than busy-polling.
Click to show internal directories.
Click to hide internal directories.