pub struct CoalescerConfig {
pub steady_delay_ms: u64,
pub burst_delay_ms: u64,
pub hard_deadline_ms: u64,
pub burst_enter_rate: f64,
pub burst_exit_rate: f64,
pub cooldown_frames: u32,
pub rate_window_size: usize,
pub enable_logging: bool,
pub enable_bocpd: bool,
pub bocpd_config: Option<BocpdConfig>,
}Expand description
Configuration for the resize coalescer.
Fields§
§steady_delay_ms: u64Maximum coalesce delay in steady regime (ms). In steady state, we want quick response.
burst_delay_ms: u64Maximum coalesce delay in burst regime (ms). During bursts, we coalesce more aggressively.
hard_deadline_ms: u64Hard deadline — always render within this time (ms). Guarantees bounded worst-case latency.
burst_enter_rate: f64Event rate threshold to enter burst mode (events/second).
burst_exit_rate: f64Event rate threshold to exit burst mode (events/second). Lower than enter_rate for hysteresis.
cooldown_frames: u32Number of frames to hold in burst mode after rate drops.
rate_window_size: usizeWindow size for rate calculation (number of events).
enable_logging: boolEnable decision logging (JSONL format).
enable_bocpd: boolEnable BOCPD (Bayesian Online Change-Point Detection) for regime detection.
When enabled, the coalescer uses a Bayesian posterior over run-lengths to detect regime changes (steady vs burst), replacing the simple rate threshold heuristics. BOCPD provides:
- Principled uncertainty quantification via P(burst)
- Automatic adaptation without hand-tuned thresholds
- Evidence logging for decision explainability
When disabled, falls back to rate threshold heuristics.
bocpd_config: Option<BocpdConfig>BOCPD configuration (used when enable_bocpd is true).
Implementations§
Source§impl CoalescerConfig
impl CoalescerConfig
Sourcepub fn with_logging(self, enabled: bool) -> Self
pub fn with_logging(self, enabled: bool) -> Self
Enable or disable decision logging.
Sourcepub fn with_bocpd(self) -> Self
pub fn with_bocpd(self) -> Self
Enable BOCPD-based regime detection with default configuration.
Sourcepub fn with_bocpd_config(self, config: BocpdConfig) -> Self
pub fn with_bocpd_config(self, config: BocpdConfig) -> Self
Enable BOCPD-based regime detection with custom configuration.
Trait Implementations§
Source§impl Clone for CoalescerConfig
impl Clone for CoalescerConfig
Source§fn clone(&self) -> CoalescerConfig
fn clone(&self) -> CoalescerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more