Regulator
A self-tuning regulator that dynamically adjusts scheduler behavior based on system performance metrics. This base class provides automatic adjustment of scheduler parameters based on real-time performance measurements and statistical analysis of timing variations.
==Measurement Collection==
The regulator collects timing measurements through periodic probes at configured intervals. These measurements are stored in a moving window, which provides an efficient way to maintain recent performance history while automatically discarding old data. This approach enables quick detection of emerging performance trends while smoothing out momentary irregularities.
==Jitter Analysis==
Collected measurements are analyzed using a moving standard deviation calculation to determine system stability. This "jitter" metric reveals performance characteristics such as sudden instability, ongoing systemic issues, and recovery patterns. The analysis focuses on detecting significant deviations that indicate potential performance problems.
==Adjustment Mechanism==
Based on the jitter analysis, the regulator makes incremental adjustments to maintain system stability. When jitter exceeds the upper threshold, the regulator adjusts using negative steps. Conversely, when jitter falls below the lower threshold and load meets the target, it adjusts with positive steps. Step sizes increase exponentially with consecutive adjustments in the same direction but reset when the direction changes, providing both responsiveness and stability.
==Configuration==
The regulator's behavior is controlled through configuration parameters that define the measurement window size, collection and regulation intervals, jitter thresholds, target load, and step escalation rate. These parameters can be tuned to match specific system characteristics and performance requirements.
Value parameters
- config
-
Configuration parameters for the regulator
- loadAvg
-
A supplier that provides the current system load average (0.0 to 1.0)
- timer
-
Timer used for scheduling periodic measurements and adjustments
Attributes
- See also
-
Config for configuration parameters
MovingStdDev for jitter calculation details
Admission for admission control implementation
Concurrency for concurrency control implementation
- Note
-
Implementations must provide probe() and update() methods to define measurement collection and adjustment application respectively.
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Admissionclass Concurrency